summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-10-28 18:33:04 -0400
committerMike Lockwood <lockwood@android.com>2009-10-28 18:33:04 -0400
commit53dcdeeb85e523e0b752d802d3413f5d4001d575 (patch)
tree2b45b09ff09fd52a4f3de490021c87e780fe8ff2
parentd02acfb908562780eec830a85e121f9925108c36 (diff)
downloadpackages_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.java5
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);
+ }
}
}