summaryrefslogtreecommitdiffstats
path: root/wifi/java
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-12-08 10:47:54 -0800
committerIrfan Sheriff <isheriff@google.com>2011-12-08 11:31:52 -0800
commit4494c906168f1b93eb9d130096036d06cfa1e291 (patch)
treedfe9fd9e670ac2b300b7eb3220988df425251a11 /wifi/java
parent641a5624075ee942b85b17646b57f65377567a06 (diff)
downloadframeworks_base-4494c906168f1b93eb9d130096036d06cfa1e291.zip
frameworks_base-4494c906168f1b93eb9d130096036d06cfa1e291.tar.gz
frameworks_base-4494c906168f1b93eb9d130096036d06cfa1e291.tar.bz2
Handle emergency call back mode correctly
Bug: 5726996 Change-Id: I5815dd402bd73c530b9ba6d545d8956064949aa2
Diffstat (limited to 'wifi/java')
-rw-r--r--wifi/java/android/net/wifi/WifiStateMachine.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 8f807fe..82abe3a 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -368,6 +368,10 @@ public class WifiStateMachine extends StateMachine {
private static final int SUCCESS = 1;
private static final int FAILURE = -1;
+ /* Phone in emergency call back mode */
+ private static final int IN_ECM_STATE = 1;
+ private static final int NOT_IN_ECM_STATE = 0;
+
/**
* The maximum number of times we will retry a connection to an access point
* for which we have failed in acquiring an IP address from DHCP. A value of
@@ -778,11 +782,11 @@ public class WifiStateMachine extends StateMachine {
/**
* TODO: doc
*/
- public void setDriverStart(boolean enable) {
+ public void setDriverStart(boolean enable, boolean ecm) {
if (enable) {
sendMessage(CMD_START_DRIVER);
} else {
- sendMessage(CMD_STOP_DRIVER);
+ sendMessage(obtainMessage(CMD_STOP_DRIVER, ecm ? IN_ECM_STATE : NOT_IN_ECM_STATE, 0));
}
}
@@ -2576,16 +2580,25 @@ public class WifiStateMachine extends StateMachine {
WifiNative.setBluetoothCoexistenceScanModeCommand(mBluetoothConnectionActive);
break;
case CMD_STOP_DRIVER:
- /* Already doing a delayed stop */
- if (mInDelayedStop) {
+ int mode = message.arg1;
+
+ /* Already doing a delayed stop && not in ecm state */
+ if (mInDelayedStop && mode != IN_ECM_STATE) {
if (DBG) log("Already in delayed stop");
break;
}
mInDelayedStop = true;
mDelayedStopCounter++;
if (DBG) log("Delayed stop message " + mDelayedStopCounter);
- sendMessageDelayed(obtainMessage(CMD_DELAYED_STOP_DRIVER, mDelayedStopCounter,
- 0), DELAYED_DRIVER_STOP_MS);
+
+ if (mode == IN_ECM_STATE) {
+ /* send a shut down immediately */
+ sendMessage(obtainMessage(CMD_DELAYED_STOP_DRIVER, mDelayedStopCounter, 0));
+ } else {
+ /* send regular delayed shut down */
+ sendMessageDelayed(obtainMessage(CMD_DELAYED_STOP_DRIVER,
+ mDelayedStopCounter, 0), DELAYED_DRIVER_STOP_MS);
+ }
break;
case CMD_START_DRIVER:
if (mInDelayedStop) {