diff options
author | Jeff Brown <jeffbrown@google.com> | 2014-08-20 14:32:38 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2014-08-20 14:45:38 -0700 |
commit | 49cb613c993a5fecf11d7ee6198068315762814e (patch) | |
tree | c9b5faa285f23a0cf98943e3ed3c400a10bb9ba5 /packages/SettingsProvider | |
parent | f1b2335a36fa6f2b9926f309a7c4ed29a1404ec4 (diff) | |
download | frameworks_base-49cb613c993a5fecf11d7ee6198068315762814e.zip frameworks_base-49cb613c993a5fecf11d7ee6198068315762814e.tar.gz frameworks_base-49cb613c993a5fecf11d7ee6198068315762814e.tar.bz2 |
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
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 21 |
1 files changed, 20 insertions, 1 deletions
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 @@ public class DatabaseHelper extends SQLiteOpenHelper { // 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 @@ public class DatabaseHelper extends SQLiteOpenHelper { 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) { |