diff options
author | Roshan Pius <rpius@google.com> | 2019-10-03 08:37:55 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-10-04 17:05:24 +0000 |
commit | 25fea7a2f8bf1978283d464d3fb3a78a7552898d (patch) | |
tree | 63dcd750b452dfafde1462a8eddbe69c6277f9e4 /tests | |
parent | 7957387b5d459386191cf45ca90e45446ed13f93 (diff) |
WifiNetworkFactory: Remove network from config manager
Remove the network configuration from config manager once the processing
of the request is complete. This will otherwise cause the next network
request for the same network to reuse existing credentials.
Bug: 141882562
Test: manual testing with the demo app.
Test: atest com.android.server.wifi
Test: Will send for regression testing.
Change-Id: Id068aab8b48d87beee1edc12f074527850eadfd0
Merged-In: Id068aab8b48d87beee1edc12f074527850eadfd0
(cherry picked from commit 7836168c83b185a1d84d292df57a6e29299c0f76)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java index 63cc8bf60..6a4dc25d8 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java @@ -1615,9 +1615,17 @@ public class WifiNetworkFactoryTest { verify(mAlarmManager).cancel(mConnectionTimeoutAlarmListenerArgumentCaptor.getValue()); // Now release the network request. + WifiConfiguration wcmNetwork = new WifiConfiguration(mSelectedNetwork); + wcmNetwork.networkId = TEST_NETWORK_ID_1; + wcmNetwork.creatorUid = TEST_UID_1; + wcmNetwork.fromWifiNetworkSpecifier = true; + wcmNetwork.ephemeral = true; + when(mWifiConfigManager.getConfiguredNetwork(mSelectedNetwork.configKey())) + .thenReturn(wcmNetwork); mWifiNetworkFactory.releaseNetworkFor(mNetworkRequest); // Verify that we triggered a disconnect. verify(mClientModeImpl, times(2)).disconnectCommand(); + verify(mWifiConfigManager).removeNetwork(TEST_NETWORK_ID_1, TEST_UID_1); // Re-enable connectivity manager . verify(mWifiConnectivityManager).setSpecificNetworkRequestInProgress(false); } |