Merge "WifiMigration: Add a settings key to indicate migration is complete" into rvc-dev am: 5f176bf91e
Change-Id: I8366886701cd706ce639188750f112b8b3184f43
This commit is contained in:
@@ -10337,6 +10337,14 @@ public final class Settings {
|
||||
@SystemApi
|
||||
public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
|
||||
|
||||
/**
|
||||
* Value to specify if wifi settings migration is complete or not.
|
||||
*
|
||||
* Type: int (0 for false, 1 for true)
|
||||
* @hide
|
||||
*/
|
||||
public static final String WIFI_MIGRATION_COMPLETED = "wifi_migration_completed";
|
||||
|
||||
/**
|
||||
* Value to specify whether network quality scores and badging should be shown in the UI.
|
||||
*
|
||||
|
||||
@@ -540,6 +540,7 @@ public class SettingsBackupTest {
|
||||
Settings.Global.WIFI_FREQUENCY_BAND,
|
||||
Settings.Global.WIFI_IDLE_MS,
|
||||
Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT,
|
||||
Settings.Global.WIFI_MIGRATION_COMPLETED,
|
||||
Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS,
|
||||
Settings.Global.WIFI_NETWORK_SHOW_RSSI,
|
||||
Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
|
||||
|
||||
@@ -522,7 +522,12 @@ public final class WifiMigration {
|
||||
*/
|
||||
@NonNull
|
||||
public static SettingsMigrationData loadFromSettings(@NonNull Context context) {
|
||||
return new SettingsMigrationData.Builder()
|
||||
if (Settings.Global.getInt(
|
||||
context.getContentResolver(), Settings.Global.WIFI_MIGRATION_COMPLETED, 0) == 1) {
|
||||
// migration already complete, ignore.
|
||||
return null;
|
||||
}
|
||||
SettingsMigrationData data = new SettingsMigrationData.Builder()
|
||||
.setScanAlwaysAvailable(
|
||||
Settings.Global.getInt(context.getContentResolver(),
|
||||
Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE, 0) == 1)
|
||||
@@ -545,5 +550,9 @@ public final class WifiMigration {
|
||||
Settings.Global.getInt(context.getContentResolver(),
|
||||
Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED, 0) == 1)
|
||||
.build();
|
||||
Settings.Global.putInt(
|
||||
context.getContentResolver(), Settings.Global.WIFI_MIGRATION_COMPLETED, 1);
|
||||
return data;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user