diff options
author | Hai Shalom <haishalom@google.com> | 2020-02-19 15:31:57 -0800 |
---|---|---|
committer | Hai Shalom <haishalom@google.com> | 2020-02-19 15:31:57 -0800 |
commit | b404ef5816a176d7575bee9bfad2dd8151c3edb2 (patch) | |
tree | 88b207210a4bb45937841396c77c695104b86ff4 /tests | |
parent | 3076deea79ac9ace03649fe578b55dd86f0707f1 (diff) |
[Passpoint] Clear ANQP cache and requests during factory reset
Clear ANQP cache and requests during factory reset.
Bug: 149866949
Test: atest WifiServiceImplTest AnqpCacheTest
Test: Perform factory reset and confirm ANQP cache and requests are
emptied.
Change-Id: I3cf7c9bda3a0cd51944aa384a50fe14d6370a612
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java | 1 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/hotspot2/AnqpCacheTest.java | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java index edd1a5ee8..08380614d 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -4021,6 +4021,7 @@ public class WifiServiceImplTest extends WifiBaseTest { network.networkId, Binder.getCallingUid(), TEST_PACKAGE_NAME); verify(mPasspointManager).removeProvider(anyInt(), anyBoolean(), eq(config.getUniqueId()), isNull()); + verify(mPasspointManager).clearAnqpRequestsAndFlushCache(); verify(mWifiConfigManager).clearDeletedEphemeralNetworks(); verify(mClientModeImpl).clearNetworkRequestUserApprovedAccessPoints(); verify(mWifiNetworkSuggestionsManager).clear(); diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/AnqpCacheTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/AnqpCacheTest.java index 1e3fdae39..c3c96cde5 100644 --- a/tests/wifitests/src/com/android/server/wifi/hotspot2/AnqpCacheTest.java +++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/AnqpCacheTest.java @@ -100,4 +100,16 @@ public class AnqpCacheTest extends WifiBaseTest { mCache.sweep(); assertNull(mCache.getEntry(ENTRY_KEY)); } + + /** + * Verify the expectation for the flush function (all entries will be removed). + * + * @throws Exception + */ + @Test + public void testCacheFlush() throws Exception { + mCache.addEntry(ENTRY_KEY, null); + mCache.flush(); + assertNull(mCache.getEntry(ENTRY_KEY)); + } } |