diff options
| author | 2012-02-13 17:02:00 -0800 | |
|---|---|---|
| committer | 2012-02-13 17:02:00 -0800 | |
| commit | b18e2c85ce574254ece4e8f2f8ed781a40c0edf2 (patch) | |
| tree | 547fa2d004c5db3a41fab885144ec439ca81c844 | |
| parent | cd9472c4ea06827289078149b0c590c9beefb82a (diff) | |
| parent | 5e264cc1c0fff5fa7a474605e446f7354b8450b0 (diff) | |
am 5e264cc1: Merge "Fix shutdown delay"
* commit '5e264cc1c0fff5fa7a474605e446f7354b8450b0':
Fix shutdown delay
| -rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index b8b7c0eaaae1..fb9286e90915 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -1625,14 +1625,14 @@ public class WifiStateMachine extends StateMachine { private void handleNetworkDisconnect() { if (DBG) log("Stopping DHCP and clearing IP"); - /* In case we were in middle of DHCP operation - restore back powermode */ - handlePostDhcpSetup(); - /* * stop DHCP */ if (mDhcpStateMachine != null) { + /* In case we were in middle of DHCP operation + restore back powermode */ + handlePostDhcpSetup(); + mDhcpStateMachine.sendMessage(DhcpStateMachine.CMD_STOP_DHCP); mDhcpStateMachine.quit(); mDhcpStateMachine = null; @@ -2395,6 +2395,10 @@ public class WifiStateMachine extends StateMachine { public void enter() { if (DBG) log(getName() + "\n"); EventLog.writeEvent(EVENTLOG_WIFI_STATE_CHANGED, getName()); + + /* Send any reset commands to supplicant before shutting it down */ + handleNetworkDisconnect(); + if (DBG) log("stopping supplicant"); if (!mWifiNative.stopSupplicant()) { loge("Failed to stop supplicant"); @@ -2405,7 +2409,6 @@ public class WifiStateMachine extends StateMachine { ++mSupplicantStopFailureToken, 0), SUPPLICANT_RESTART_INTERVAL_MSECS); mNetworkInfo.setIsAvailable(false); - handleNetworkDisconnect(); setWifiState(WIFI_STATE_DISABLING); sendSupplicantConnectionChangedBroadcast(false); mSupplicantStateTracker.sendMessage(CMD_RESET_SUPPLICANT_STATE); |