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

Commit 767a0625 authored by Fiona Campbell's avatar Fiona Campbell
Browse files

Don't disable autobrightness with key press

- don't disable autobrightness on brightness up/down key press
- there are no other side effects to this
- the brightness changes are still considered as user interactions

Bug: 332323629
Flag: EXEMPT bug fix
Test: manual, atest DisplayServiceTests
Change-Id: Ia24f41b2eb2343b13000f1a28e3a75a497f5f354
parent 61dfb4a0
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -3581,18 +3581,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                if (down) {
                    int direction = keyCode == KeyEvent.KEYCODE_BRIGHTNESS_UP ? 1 : -1;

                    // Disable autobrightness if it's on
                    int auto = Settings.System.getIntForUser(
                            mContext.getContentResolver(),
                            Settings.System.SCREEN_BRIGHTNESS_MODE,
                            Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
                            UserHandle.USER_CURRENT_OR_SELF);
                    if (auto != 0) {
                        Settings.System.putIntForUser(mContext.getContentResolver(),
                                Settings.System.SCREEN_BRIGHTNESS_MODE,
                                Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
                                UserHandle.USER_CURRENT_OR_SELF);
                    }
                    int screenDisplayId = displayId < 0 ? DEFAULT_DISPLAY : displayId;

                    float minLinearBrightness = mPowerManager.getBrightnessConstraint(