WifiManagerTest: Use getPrivilegedConfiguredNetworks() in factory reset test

Bug: 152048238
Test:  atest android.net.wifi.cts.WifiManagerTest
Reproduced the original issue (i.e tests after testFactoryReset failing) with a
PSK network on the device & verified that this CL fixes the failures.

Change-Id: I56947a78142e971c8da6a1c098ebbd0f1e7d370d
This commit is contained in:
Roshan Pius
2020-03-23 08:06:00 -07:00
parent 01a461c223
commit ad92bb63b5

View File

@@ -2166,7 +2166,7 @@ public class WifiManagerTest extends AndroidTestCase {
uiAutomation.adoptShellPermissionIdentity();
// These below API's only work with privileged permissions (obtained via shell identity
// for test)
savedNetworks = mWifiManager.getConfiguredNetworks();
savedNetworks = mWifiManager.getPrivilegedConfiguredNetworks();
mWifiManager.factoryReset();
// Ensure all the saved networks are removed.