From bf4a0d9b27116449470932b997dc885d833f5ce7 Mon Sep 17 00:00:00 2001 From: Rebecca Silberstein Date: Wed, 9 May 2018 22:19:11 -0700 Subject: WifiStateMachine: send supplicant connection bcast When tearing down client mode, add broadcast indicating that the supplicant connection state has changed. While this is often misused to indicate wifi connection state, we cannot remove it yet. The broadcast has been deprecated and will be removed in the future, but for now, we still send the broadcast at the start and end of client mode. Bug: 79477256 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Id5dc4f4debf653968d8dca702c42fef89a5ad642 --- service/java/com/android/server/wifi/WifiStateMachine.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 4a0a24a21..4a51ffceb 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -2665,6 +2665,12 @@ public class WifiStateMachine extends StateMachine { mContext.sendBroadcastAsUser(intent, UserHandle.ALL); } + /** + * Helper method used to send state about supplicant - This is NOT information about the current + * wifi connection state. + * + * TODO: b/79504296 This broadcast has been deprecated and should be removed + */ private void sendSupplicantConnectionChangedBroadcast(boolean connected) { Intent intent = new Intent(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); @@ -3701,6 +3707,7 @@ public class WifiStateMachine extends StateMachine { if (!mWifiConfigManager.migrateFromLegacyStore()) { Log.e(TAG, "Failed to migrate from legacy config store"); } + // TODO: b/79504296 This broadcast has been deprecated and should be removed sendSupplicantConnectionChangedBroadcast(true); mWifiNative.setExternalSim(mInterfaceName, true); @@ -3766,6 +3773,8 @@ public class WifiStateMachine extends StateMachine { if (mNetworkAgent != null) mNetworkAgent.sendNetworkInfo(mNetworkInfo); mCountryCode.setReadyForChange(false); mInterfaceName = null; + // TODO: b/79504296 This broadcast has been deprecated and should be removed + sendSupplicantConnectionChangedBroadcast(false); } void registerConnected() { -- cgit v1.2.3