diff options
author | Mike Lockwood <lockwood@android.com> | 2009-10-28 18:33:04 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-10-28 18:33:04 -0400 |
commit | 53dcdeeb85e523e0b752d802d3413f5d4001d575 (patch) | |
tree | 2b45b09ff09fd52a4f3de490021c87e780fe8ff2 | |
parent | d02acfb908562780eec830a85e121f9925108c36 (diff) | |
download | packages_apps_settings-53dcdeeb85e523e0b752d802d3413f5d4001d575.zip packages_apps_settings-53dcdeeb85e523e0b752d802d3413f5d4001d575.tar.gz packages_apps_settings-53dcdeeb85e523e0b752d802d3413f5d4001d575.tar.bz2 |
Don't restore old brightness when cancelling brightness dialog in automatic mode.
Fixes a problem that could result in the backlight getting set to a bogus brightness
level if you open the dialog and cancel when in automatic mode.
Bug b/2015734
Change-Id: I302697e4ebd37afcdbfdd74ba0b1cc9be27ee40b
Signed-off-by: Mike Lockwood <lockwood@android.com>
-rw-r--r-- | src/com/android/settings/BrightnessPreference.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/settings/BrightnessPreference.java b/src/com/android/settings/BrightnessPreference.java index 994546d..dbfa2f7 100644 --- a/src/com/android/settings/BrightnessPreference.java +++ b/src/com/android/settings/BrightnessPreference.java @@ -120,8 +120,9 @@ public class BrightnessPreference extends SeekBarPreference implements if (mAutomaticAvailable) { setMode(mOldAutomatic); } - // brightness needs to be restored after restoring ALS mode - setBrightness(mOldBrightness); + if (!mAutomaticAvailable || mOldAutomatic == 0) { + setBrightness(mOldBrightness); + } } } |