diff options
author | Rebecca Silberstein <silberst@google.com> | 2018-05-09 20:48:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-05-09 20:48:21 +0000 |
commit | 2c88f670aad308c91801c7bfeabbce8d78a506fe (patch) | |
tree | 96fdc82c8a5686304e1e10258e8ffd0e38d8009b /service | |
parent | 1a0ff86a3520e9b79ded4746171a883a7f72fcdf (diff) | |
parent | 5b63400e5624455eeb9ddb3fe8078e1bc5ebcd13 (diff) |
Merge changes I848ba9b1,I03a75b45 into pi-dev
* changes:
ClientModeManager: immediately clean up state onDestroyed
SoftApManager: no teardown when iface destroyed
Diffstat (limited to 'service')
3 files changed, 18 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeManager.java b/service/java/com/android/server/wifi/ClientModeManager.java index 8aecd1ebd..f55d9d297 100644 --- a/service/java/com/android/server/wifi/ClientModeManager.java +++ b/service/java/com/android/server/wifi/ClientModeManager.java @@ -133,6 +133,13 @@ public class ClientModeManager implements ActiveModeManager { @Override public void onDestroyed(String ifaceName) { if (mClientInterfaceName != null && mClientInterfaceName.equals(ifaceName)) { + Log.d(TAG, "STA iface " + ifaceName + " was destroyed, stopping client mode"); + + // we must immediately clean up state in WSM to unregister all client mode + // related objects + // Note: onDestroyed is only called from the WSM thread + mWifiStateMachine.handleIfaceDestroyed(); + sendMessage(CMD_INTERFACE_DESTROYED); } } diff --git a/service/java/com/android/server/wifi/SoftApManager.java b/service/java/com/android/server/wifi/SoftApManager.java index a23d046e3..1716015a2 100644 --- a/service/java/com/android/server/wifi/SoftApManager.java +++ b/service/java/com/android/server/wifi/SoftApManager.java @@ -456,10 +456,9 @@ public class SoftApManager implements ActiveModeManager { @Override public void exit() { - if (mApInterfaceName == null) { - return; + if (mApInterfaceName != null) { + stopSoftAp(); } - stopSoftAp(); if (mSettingObserver != null) { mSettingObserver.unregister(); } @@ -531,6 +530,7 @@ public class SoftApManager implements ActiveModeManager { Log.d(TAG, "Interface was cleanly destroyed."); updateApState(WifiManager.WIFI_AP_STATE_DISABLING, WifiManager.WIFI_AP_STATE_ENABLED, 0); + mApInterfaceName = null; transitionTo(mIdleState); break; case CMD_INTERFACE_DOWN: diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 18241d57a..bca20e43d 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -1440,6 +1440,14 @@ public class WifiStateMachine extends StateMachine { } /** + * When the underlying interface is destroyed, we must immediately tell connectivity service to + * mark network agent as disconnected and stop the ip client. + */ + public void handleIfaceDestroyed() { + handleNetworkDisconnect(); + } + + /** * TODO: doc */ public void setOperationalMode(int mode, String ifaceName) { |