diff options
author | Irfan Sheriff <isheriff@google.com> | 2011-04-07 15:56:22 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2011-04-19 07:33:07 -0700 |
commit | 5cd8d4decea60fccb52614b15bd0ceaa9fecc384 (patch) | |
tree | 553cca2b67fda2b980efedbc03e92801be5a80f0 /wifi/java/android | |
parent | f76dc56c33ba66138af70d72803cf55f881c3717 (diff) | |
download | frameworks_base-5cd8d4decea60fccb52614b15bd0ceaa9fecc384.zip frameworks_base-5cd8d4decea60fccb52614b15bd0ceaa9fecc384.tar.gz frameworks_base-5cd8d4decea60fccb52614b15bd0ceaa9fecc384.tar.bz2 |
handle supplicant stop after child states exit
When a user explicitly disables wifi, wait on the supplicant shut down until after
all child states have handled exit - this avoids time outs due to communicating with
supplicant after breaking the socket connection
Bug: 4052161
Change-Id: Iec5bb3e14a2df4a8a12de8bb81d9c10aeb992ad4
Diffstat (limited to 'wifi/java/android')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index f7157d4..16611d8 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -1978,17 +1978,6 @@ public class WifiStateMachine extends StateMachine { boolean eventLoggingEnabled = true; switch(message.what) { case CMD_STOP_SUPPLICANT: /* Supplicant stopped by user */ - Log.d(TAG, "stopping supplicant"); - if (!WifiNative.stopSupplicant()) { - Log.e(TAG, "Failed to stop supplicant, issue kill"); - WifiNative.killSupplicant(); - } - mNetworkInfo.setIsAvailable(false); - handleNetworkDisconnect(); - setWifiState(WIFI_STATE_DISABLING); - sendSupplicantConnectionChangedBroadcast(false); - mSupplicantStateTracker.sendMessage(CMD_RESET_SUPPLICANT_STATE); - mWpsStateMachine.sendMessage(CMD_RESET_WPS_STATE); transitionTo(mSupplicantStoppingState); break; case SUP_DISCONNECTION_EVENT: /* Supplicant connection lost */ @@ -2089,6 +2078,17 @@ public class WifiStateMachine extends StateMachine { public void enter() { if (DBG) Log.d(TAG, getName() + "\n"); EventLog.writeEvent(EVENTLOG_WIFI_STATE_CHANGED, getName()); + Log.d(TAG, "stopping supplicant"); + if (!WifiNative.stopSupplicant()) { + Log.e(TAG, "Failed to stop supplicant, issue kill"); + WifiNative.killSupplicant(); + } + mNetworkInfo.setIsAvailable(false); + handleNetworkDisconnect(); + setWifiState(WIFI_STATE_DISABLING); + sendSupplicantConnectionChangedBroadcast(false); + mSupplicantStateTracker.sendMessage(CMD_RESET_SUPPLICANT_STATE); + mWpsStateMachine.sendMessage(CMD_RESET_WPS_STATE); } @Override public boolean processMessage(Message message) { |