diff options
author | David Su <dysu@google.com> | 2020-06-12 15:48:35 -0700 |
---|---|---|
committer | David Su <dysu@google.com> | 2020-06-13 00:23:44 +0000 |
commit | fc132e8df75297ece1f83a0bfa64a5d0141c359b (patch) | |
tree | caf0fae0bcffb0858b8ae985fde043bf9b0a91df /service | |
parent | e0adae2b89091561ab918f3cc1ff60f21121e197 (diff) |
RESTRICT AUTOMERGE Send out WIFI_CREDENTIAL_CHANGED_ACTION on WifiManager#forget() success
Will be fixed separately in master.
Bug: 158874479
Test: atest FrameworksWifiTests
Test: connect to and forget some networks
Change-Id: I8487bab0e2b9ff7188438ccdb60f2f3dfd74f387
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index e10d5367e..8036a0dcc 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -5794,14 +5794,13 @@ public class ClientModeImpl extends StateMachine { */ private void broadcastWifiCredentialChanged(int wifiCredentialEventType, WifiConfiguration config) { - if (config != null && config.preSharedKey != null) { - Intent intent = new Intent(WifiManager.WIFI_CREDENTIAL_CHANGED_ACTION); + Intent intent = new Intent(WifiManager.WIFI_CREDENTIAL_CHANGED_ACTION); + if (config != null && config.SSID != null) { intent.putExtra(WifiManager.EXTRA_WIFI_CREDENTIAL_SSID, config.SSID); - intent.putExtra(WifiManager.EXTRA_WIFI_CREDENTIAL_EVENT_TYPE, - wifiCredentialEventType); - mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT, - android.Manifest.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE); } + intent.putExtra(WifiManager.EXTRA_WIFI_CREDENTIAL_EVENT_TYPE, wifiCredentialEventType); + mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT, + android.Manifest.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE); } void handleGsmAuthRequest(SimAuthRequestData requestData) { @@ -6220,13 +6219,14 @@ public class ClientModeImpl extends StateMachine { if (callback != null && binder != null) { mProcessingActionListeners.add(binder, callback, callbackIdentifier); } + WifiConfiguration config = mWifiConfigManager.getConfiguredNetwork(netId); boolean success = mWifiConfigManager.removeNetwork(netId, callingUid, null); if (!success) { loge("Failed to remove network"); sendActionListenerFailure(callbackIdentifier, WifiManager.ERROR); } sendActionListenerSuccess(callbackIdentifier); - broadcastWifiCredentialChanged(WifiManager.WIFI_CREDENTIAL_FORGOT, null); + broadcastWifiCredentialChanged(WifiManager.WIFI_CREDENTIAL_FORGOT, config); }); } |