From 53dcdeeb85e523e0b752d802d3413f5d4001d575 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 28 Oct 2009 18:33:04 -0400 Subject: 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 --- src/com/android/settings/BrightnessPreference.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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); + } } } -- cgit v1.1