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

Commit 05204840 authored by Dan Gittik's avatar Dan Gittik
Browse files

Fixed screen brightness override in manual mode.

The screen brightness override would make itself persistent, to
communicate to the user her changes aren't taking place. However,
this caused a bug in manual brightness mode, because the setting
was never cleare, so it was removed.

Test: manual.

Change-Id: I187ed7a4691ba15284cf50adf8266ff161878c2a
Fixes: 78519580
parent 032ab152
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;