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

Commit 8deb9fbc authored by Piotr Wilczyński's avatar Piotr Wilczyński
Browse files

Switch to doze auto-brightness mode based on screen state

When the device is in doze and a tilt-to-wake gesture is performed, the screen state changes to ON but the policy is still DOZE. In that situation, we should use the default brightness curve, not the doze one.

Bug: 328092771
Test: adb logcat | grep -i "brightnessEvent"
Test: atest DisplayPowerControllerTest
Change-Id: Ib3ec248f8559b7cdaf546489e1006fee53d6e710
parent d0658959
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1379,7 +1379,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
        // Switch to doze auto-brightness mode if needed
        if (mFlags.areAutoBrightnessModesEnabled() && mAutomaticBrightnessController != null
                && !mAutomaticBrightnessController.isInIdleMode()) {
            mAutomaticBrightnessController.switchMode(mPowerRequest.policy == POLICY_DOZE
            mAutomaticBrightnessController.switchMode(Display.isDozeState(state)
                    ? AUTO_BRIGHTNESS_MODE_DOZE : AUTO_BRIGHTNESS_MODE_DEFAULT);
        }