From 1cc4d564f2e0901c9f44211ff60958ab0471f363 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 7 Jul 2020 10:04:38 +0800 Subject: wifi: remove cached hal data on updating a network Bug: 160551408 Test: atest FrameworksWifiTests Change-Id: I1369978c9af1bb75ff76edd3b7ba8b22f921884c --- .../src/com/android/server/wifi/ClientModeImplTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java index 11ee5cd7c..23726786d 100644 --- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java @@ -5237,6 +5237,20 @@ public class ClientModeImplTest extends WifiBaseTest { verify(mWifiNative, never()).removeNetworkCachedData(anyInt()); } + /** + * Verify that network cached data is cleared on updating a network. + */ + @Test + public void testNetworkCachedDataIsClearedOnUpdatingNetwork() throws Exception { + WifiConfiguration oldConfig = new WifiConfiguration(mConnectedNetwork); + mConnectedNetwork.meteredOverride = METERED_OVERRIDE_METERED; + + mConfigUpdateListenerCaptor.getValue().onNetworkUpdated(mConnectedNetwork, oldConfig); + mLooper.dispatchAll(); + verify(mWifiNative).removeNetworkCachedData(eq(oldConfig.networkId)); + } + + @Test public void testIpReachabilityLostAndRoamEventsRace() throws Exception { connect(); -- cgit v1.2.3