summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-04-03 15:18:13 -0700
committerRoshan Pius <rpius@google.com>2017-04-03 22:41:27 +0000
commit6f1055408a43428ababffc1d1fa928c825924680 (patch)
treeaa901579a543d35b15022c5a122a1b135acc02f5 /tests
parent31eb1e8997a0ee98df33f6d8b3b907e0fcb070ed (diff)
WifiConfigManager: Persist immediately on enable/disable network
The change in network state due to public API calls should be immediately persisted (not wait for the buffered write from updateNetworkSelectionStatus to kick in after 10 seconds). This was detected in the test: |test_reboot_configstore_reconnect| which connects to a network and immediately reboots the device. This prevents the last buffered write (for enabling network) to be flushed out and hence the network is reloaded as disabled. Bug: 35811529 Test: Unit tests Change-Id: I6f769429df67d83ad014ef552901a7b1419c7721
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
index 951f8e114..dffd9ba9e 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
@@ -707,7 +707,7 @@ public class WifiConfigManagerTest {
* {@link WifiConfigManager#disableNetwork(int, int)}.
*/
@Test
- public void testEnableDisableNetwork() {
+ public void testEnableDisableNetwork() throws Exception {
WifiConfiguration openNetwork = WifiConfigurationTestUtil.createOpenNetwork();
NetworkUpdateResult result = verifyAddNetworkToWifiConfigManager(openNetwork);
@@ -719,6 +719,7 @@ public class WifiConfigManagerTest {
NetworkSelectionStatus retrievedStatus = retrievedNetwork.getNetworkSelectionStatus();
assertTrue(retrievedStatus.isNetworkEnabled());
verifyUpdateNetworkStatus(retrievedNetwork, WifiConfiguration.Status.ENABLED);
+ mContextConfigStoreMockOrder.verify(mWifiConfigStore).write(eq(true));
// Now set it disabled.
assertTrue(mWifiConfigManager.disableNetwork(result.getNetworkId(), TEST_CREATOR_UID));
@@ -726,6 +727,7 @@ public class WifiConfigManagerTest {
retrievedStatus = retrievedNetwork.getNetworkSelectionStatus();
assertTrue(retrievedStatus.isNetworkPermanentlyDisabled());
verifyUpdateNetworkStatus(retrievedNetwork, WifiConfiguration.Status.DISABLED);
+ mContextConfigStoreMockOrder.verify(mWifiConfigStore).write(eq(true));
}
/**