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

Commit 52c07474 authored by Kenny Guy's avatar Kenny Guy Committed by Android (Google) Code Review
Browse files

Merge "Fix manual brightness slider"

parents a61111ab ad9a6ea8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -479,6 +479,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
        mScreenBrightnessForVr = getScreenBrightnessForVrSetting();
        mAutoBrightnessAdjustment = getAutoBrightnessAdjustmentSetting();
        mTemporaryScreenBrightness = -1;
        mPendingScreenBrightnessSetting = -1;
        mTemporaryAutoBrightnessAdjustment = Float.NaN;
    }

@@ -1476,6 +1477,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
            mPendingScreenBrightnessSetting = -1;
            return false;
        }
        mCurrentScreenBrightnessSetting = mPendingScreenBrightnessSetting;
        mLastUserSetScreenBrightness = mPendingScreenBrightnessSetting;
        mPendingScreenBrightnessSetting = -1;
        return true;
@@ -1484,7 +1486,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
    private void notifyBrightnessChanged(int brightness, boolean userInitiated,
            boolean hadUserDataPoint) {
        final float brightnessInNits = convertToNits(brightness);
        if (brightnessInNits >= 0.0f && mAutomaticBrightnessController != null) {
        if (mPowerRequest.useAutoBrightness && brightnessInNits >= 0.0f
                && mAutomaticBrightnessController != null) {
            // We only want to track changes on devices that can actually map the display backlight
            // values into a physical brightness unit since the value provided by the API is in
            // nits and not using the arbitrary backlight units.