Reset auto-brightness setting to default.
Reset the auto-brightness setting to default since the behavior
of the feature is now quite different and is being presented to
the user in a new way as "adaptive brightness".
Bug: 17114082
Change-Id: Ica63f4caaaf50ad95dc9df88bb376f79782976f7
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 13301fb..edefb13 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -70,7 +70,7 @@
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
// is properly propagated through your change. Not doing so will result in a loss of user
// settings.
- private static final int DATABASE_VERSION = 107;
+ private static final int DATABASE_VERSION = 108;
private Context mContext;
private int mUserHandle;
@@ -1714,6 +1714,25 @@
upgradeVersion = 107;
}
+ if (upgradeVersion < 108) {
+ // Reset the auto-brightness setting to default since the behavior
+ // of the feature is now quite different and is being presented to
+ // the user in a new way as "adaptive brightness".
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)"
+ + " VALUES(?,?);");
+ loadBooleanSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_MODE,
+ R.bool.def_screen_brightness_automatic_mode);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null) stmt.close();
+ }
+ upgradeVersion = 108;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {