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:
@@ -120,10 +120,11 @@ public class BrightnessPreference extends SeekBarPreference implements
|
|||||||
if (mAutomaticAvailable) {
|
if (mAutomaticAvailable) {
|
||||||
setMode(mOldAutomatic);
|
setMode(mOldAutomatic);
|
||||||
}
|
}
|
||||||
// brightness needs to be restored after restoring ALS mode
|
if (!mAutomaticAvailable || mOldAutomatic == 0) {
|
||||||
setBrightness(mOldBrightness);
|
setBrightness(mOldBrightness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void setBrightness(int brightness) {
|
private void setBrightness(int brightness) {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user