Merge "WifiMigration: Add test for the config store APIs" into rvc-dev am: 01a461c223
Change-Id: Ic839b4f56b31f1a8502e4f5a4bf803c3606d4d81
This commit is contained in:
@@ -16,7 +16,10 @@
|
||||
|
||||
package android.net.wifi.cts;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.net.wifi.WifiMigration;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.test.AndroidTestCase;
|
||||
|
||||
public class WifiMigrationTest extends AndroidTestCase {
|
||||
@@ -75,9 +78,61 @@ public class WifiMigrationTest extends AndroidTestCase {
|
||||
*/
|
||||
public void testWifiMigrationSettings() throws Exception {
|
||||
try {
|
||||
// ensure that this does not crash.
|
||||
WifiMigration.loadFromSettings(getContext());
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests {@link WifiMigration#convertAndRetrieveSharedConfigStoreFile(int)},
|
||||
* {@link WifiMigration#convertAndRetrieveUserConfigStoreFile(int, UserHandle)},
|
||||
* {@link WifiMigration#removeSharedConfigStoreFile(int)} and
|
||||
* {@link WifiMigration#removeUserConfigStoreFile(int, UserHandle)}.
|
||||
*/
|
||||
public void testWifiMigrationConfigStore() throws Exception {
|
||||
try {
|
||||
WifiMigration.convertAndRetrieveSharedConfigStoreFile(
|
||||
WifiMigration.STORE_FILE_SHARED_GENERAL);
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
try {
|
||||
WifiMigration.convertAndRetrieveSharedConfigStoreFile(
|
||||
WifiMigration.STORE_FILE_SHARED_SOFTAP);
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
try {
|
||||
WifiMigration.convertAndRetrieveUserConfigStoreFile(
|
||||
WifiMigration.STORE_FILE_USER_GENERAL,
|
||||
UserHandle.of(ActivityManager.getCurrentUser()));
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
try {
|
||||
WifiMigration.convertAndRetrieveUserConfigStoreFile(
|
||||
WifiMigration.STORE_FILE_USER_NETWORK_SUGGESTIONS,
|
||||
UserHandle.of(ActivityManager.getCurrentUser()));
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
try {
|
||||
WifiMigration.removeSharedConfigStoreFile(
|
||||
WifiMigration.STORE_FILE_SHARED_GENERAL);
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
try {
|
||||
WifiMigration.removeSharedConfigStoreFile(
|
||||
WifiMigration.STORE_FILE_SHARED_SOFTAP);
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
try {
|
||||
WifiMigration.removeUserConfigStoreFile(
|
||||
WifiMigration.STORE_FILE_USER_GENERAL,
|
||||
UserHandle.of(ActivityManager.getCurrentUser()));
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
try {
|
||||
WifiMigration.removeUserConfigStoreFile(
|
||||
WifiMigration.STORE_FILE_USER_NETWORK_SUGGESTIONS,
|
||||
UserHandle.of(ActivityManager.getCurrentUser()));
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user