Merge "Some logging for settings reset"
This commit is contained in:
committed by
Android (Google) Code Review
commit
a25c24d882
@@ -9740,6 +9740,16 @@ public final class Settings {
|
||||
*/
|
||||
public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
|
||||
|
||||
/**
|
||||
* The build id of when the settings database was first created (or re-created due it
|
||||
* being missing).
|
||||
*
|
||||
* Type: string
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
|
||||
|
||||
/**
|
||||
* Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
|
||||
* default. Set to 0 to disable.
|
||||
|
||||
@@ -141,6 +141,7 @@ public class SettingsBackupTest {
|
||||
Settings.Global.CONTACTS_DATABASE_WAL_ENABLED,
|
||||
Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE,
|
||||
Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI,
|
||||
Settings.Global.DATABASE_CREATION_BUILDID,
|
||||
Settings.Global.DATABASE_DOWNGRADE_REASON,
|
||||
Settings.Global.DATA_ROAMING,
|
||||
Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS,
|
||||
|
||||
@@ -2037,6 +2037,8 @@ public class SettingsProvider extends ContentProvider {
|
||||
|
||||
private final BackupManager mBackupManager;
|
||||
|
||||
private String mSettingsCreationBuildId;
|
||||
|
||||
public SettingsRegistry() {
|
||||
mHandler = new MyHandler(getContext().getMainLooper());
|
||||
mGenerationRegistry = new GenerationRegistry(mLock);
|
||||
@@ -2502,6 +2504,8 @@ public class SettingsProvider extends ContentProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
mSettingsCreationBuildId = Build.ID;
|
||||
|
||||
final long identity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
List<UserInfo> users = mUserManager.getUsers(true);
|
||||
@@ -2570,6 +2574,12 @@ public class SettingsProvider extends ContentProvider {
|
||||
ensureSettingsStateLocked(globalKey);
|
||||
SettingsState globalSettings = mSettingsStates.get(globalKey);
|
||||
migrateLegacySettingsLocked(globalSettings, database, TABLE_GLOBAL);
|
||||
// If this was just created
|
||||
if (mSettingsCreationBuildId != null) {
|
||||
globalSettings.insertSettingLocked(Settings.Global.DATABASE_CREATION_BUILDID,
|
||||
mSettingsCreationBuildId, null, true,
|
||||
SettingsState.SYSTEM_PACKAGE_NAME);
|
||||
}
|
||||
globalSettings.persistSyncLocked();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user