Loading core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -8723,6 +8723,16 @@ public final class Settings { */ public static final String RETAIL_DEMO_MODE_CONSTANTS = "retail_demo_mode_constants"; /** * The reason for the settings database being downgraded. This is only for * troubleshooting purposes and its value should not be interpreted in any way. * * Type: string * * @hide */ public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; /** * Settings to backup. This is here so that it's in the same place as the settings * keys and easy to update. Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +8 −2 Original line number Diff line number Diff line Loading @@ -114,7 +114,7 @@ import java.util.regex.Pattern; public class SettingsProvider extends ContentProvider { private static final boolean DEBUG = false; private static final boolean DROP_DATABASE_ON_MIGRATION = !Build.IS_DEBUGGABLE; private static final boolean DROP_DATABASE_ON_MIGRATION = true; private static final String LOG_TAG = "SettingsProvider"; Loading Loading @@ -2142,6 +2142,12 @@ public class SettingsProvider extends ContentProvider { // Now upgrade should work fine. onUpgradeLocked(mUserId, oldVersion, newVersion); // Make a note what happened, so we don't wonder why data was lost String reason = "Settings rebuilt! Current version: " + curVersion + " while expected: " + newVersion; getGlobalSettingsLocked().insertSettingLocked( Settings.Global.DATABASE_DOWNGRADE_REASON, reason, "android"); } // Set the global settings version if owner. Loading Loading @@ -2411,7 +2417,7 @@ public class SettingsProvider extends ContentProvider { } if (currentVersion != newVersion) { Slog.w("SettingsProvider", "warning: upgrading settings database to version " Slog.wtf("SettingsProvider", "warning: upgrading settings database to version " + newVersion + " left it at " + currentVersion + " instead; this is probably a bug", new Throwable()); if (DEBUG) { Loading Loading
core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -8723,6 +8723,16 @@ public final class Settings { */ public static final String RETAIL_DEMO_MODE_CONSTANTS = "retail_demo_mode_constants"; /** * The reason for the settings database being downgraded. This is only for * troubleshooting purposes and its value should not be interpreted in any way. * * Type: string * * @hide */ public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; /** * Settings to backup. This is here so that it's in the same place as the settings * keys and easy to update. Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +8 −2 Original line number Diff line number Diff line Loading @@ -114,7 +114,7 @@ import java.util.regex.Pattern; public class SettingsProvider extends ContentProvider { private static final boolean DEBUG = false; private static final boolean DROP_DATABASE_ON_MIGRATION = !Build.IS_DEBUGGABLE; private static final boolean DROP_DATABASE_ON_MIGRATION = true; private static final String LOG_TAG = "SettingsProvider"; Loading Loading @@ -2142,6 +2142,12 @@ public class SettingsProvider extends ContentProvider { // Now upgrade should work fine. onUpgradeLocked(mUserId, oldVersion, newVersion); // Make a note what happened, so we don't wonder why data was lost String reason = "Settings rebuilt! Current version: " + curVersion + " while expected: " + newVersion; getGlobalSettingsLocked().insertSettingLocked( Settings.Global.DATABASE_DOWNGRADE_REASON, reason, "android"); } // Set the global settings version if owner. Loading Loading @@ -2411,7 +2417,7 @@ public class SettingsProvider extends ContentProvider { } if (currentVersion != newVersion) { Slog.w("SettingsProvider", "warning: upgrading settings database to version " Slog.wtf("SettingsProvider", "warning: upgrading settings database to version " + newVersion + " left it at " + currentVersion + " instead; this is probably a bug", new Throwable()); if (DEBUG) { Loading