summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHai Shalom <haishalom@google.com>2020-08-03 15:44:42 -0700
committerHai Shalom <haishalom@google.com>2020-08-04 21:47:54 +0000
commit0328224348fe41e2df48e811d5311c90209cd40e (patch)
treed67f0ae724e0125f69b6301d844c5bf8ac8928c4
parentece9f2221fcb68c1f18ab78966e7eb8f5049dfdd (diff)
Flush ANQP caches when toggling Wi-Fi off
Bug: 154217281 Test: atest ClientModeImplTest Test: Toggle Wi-Fi off, verify ANQP caches are flushed Change-Id: I8a55771d1062a12e12ca37b2f34e15b5ead8fb65 Merged-In: I8a55771d1062a12e12ca37b2f34e15b5ead8fb65 (cherry picked from commit 103512e9be756fa95e5a57525b57eca5a4b582a4)
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java3
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java1
2 files changed, 3 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index fd79d8258..c1768eca9 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -3686,9 +3686,10 @@ public class ClientModeImpl extends StateMachine {
// TODO: b/79504296 This broadcast has been deprecated and should be removed
sendSupplicantConnectionChangedBroadcast(false);
- // Let's remove any ephemeral or passpoint networks.
+ // Remove any ephemeral or Passpoint networks, flush ANQP cache
mWifiConfigManager.removeAllEphemeralOrPasspointConfiguredNetworks();
mWifiConfigManager.clearUserTemporarilyDisabledList();
+ mPasspointManager.clearAnqpRequestsAndFlushCache();
}
void registerConnected() {
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
index 3048ef3d5..aea141587 100644
--- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
@@ -2364,6 +2364,7 @@ public class ClientModeImplTest extends WifiBaseTest {
inOrderMetrics.verify(mWifiMetrics).logStaEvent(StaEvent.TYPE_WIFI_DISABLED);
assertNull(wifiInfo.getBSSID());
assertEquals(SupplicantState.DISCONNECTED, wifiInfo.getSupplicantState());
+ verify(mPasspointManager).clearAnqpRequestsAndFlushCache();
// Send a SUPPLICANT_STATE_CHANGE_EVENT, verify WifiInfo is not updated
mCmi.sendMessage(WifiMonitor.SUPPLICANT_STATE_CHANGE_EVENT, 0, 0,