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>
This commit is contained in:
Mike Lockwood
2009-10-28 18:33:04 -04:00
parent d02acfb908
commit 53dcdeeb85

View File

@@ -120,10 +120,11 @@ public class BrightnessPreference extends SeekBarPreference implements
if (mAutomaticAvailable) {
setMode(mOldAutomatic);
}
// brightness needs to be restored after restoring ALS mode
if (!mAutomaticAvailable || mOldAutomatic == 0) {
setBrightness(mOldBrightness);
}
}
}
private void setBrightness(int brightness) {
try {