WifiManagerTest: Use addNetwork + enableNetwork instead of save
WifiManager.save() is an asynchronous operation. This is sometime causing the tests to be flaky (dropShellIdentity occurs while this is being processed). Use the synchronous legacy API's instead for rewinding the effects of factory reset. Bug: 152048238 Test: atest android.net.wifi.cts.WifiManagerTest Change-Id: Ibb0e04cf931511fcda1b1a81fd6eda4583196c2e
This commit is contained in:
@@ -2183,7 +2183,9 @@ public class WifiManagerTest extends AndroidTestCase {
|
||||
// Restore the original saved networks.
|
||||
if (savedNetworks != null) {
|
||||
for (WifiConfiguration network : savedNetworks) {
|
||||
mWifiManager.save(network, null);
|
||||
network.networkId = WifiConfiguration.INVALID_NETWORK_ID;
|
||||
int networkId = mWifiManager.addNetwork(network);
|
||||
mWifiManager.enableNetwork(networkId, false);
|
||||
}
|
||||
}
|
||||
uiAutomation.dropShellPermissionIdentity();
|
||||
|
||||
Reference in New Issue
Block a user