Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53dcdeeb authored by Mike Lockwood's avatar Mike Lockwood
Browse files

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: default avatarMike Lockwood <lockwood@android.com>
parent d02acfb9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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 {