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

Commit bfb35ad0 authored by android-build-team Robot's avatar android-build-team Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed screen brightness override in manual mode." into pi-dev

parents 9411ab15 05204840
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -774,14 +774,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
            brightness = mScreenBrightnessForVr;
        }

        boolean setBrightnessToOverride = false;
        if (brightness < 0 && mPowerRequest.screenBrightnessOverride > 0) {
            brightness = mPowerRequest.screenBrightnessOverride;
            // If there's a screen brightness override, we want to reset the brightness to it
            // whenever the user changes it, to communicate that these changes aren't taking
            // effect. However, for a nicer user experience, we don't do it here, but rather after
            // the temporary brightness has been taken into account.
            setBrightnessToOverride = true;
        }

        final boolean autoBrightnessEnabledInDoze =
@@ -804,12 +798,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
            brightnessIsTemporary = true;
        }

        // Reset the brightness to the screen brightness override to communicate to the user that
        // her changes aren't taking effect.
        if (setBrightnessToOverride && !brightnessIsTemporary) {
            putScreenBrightnessSetting(brightness);
        }

        final boolean autoBrightnessAdjustmentChanged = updateAutoBrightnessAdjustment();
        if (autoBrightnessAdjustmentChanged) {
            mTemporaryAutoBrightnessAdjustment = Float.NaN;