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

Commit b19e7283 authored by Fiona Campbell's avatar Fiona Campbell Committed by Automerger Merge Worker
Browse files

Merge "Fix screen-on speed during phone call" into rvc-dev am: a0cecdfe am:...

Merge "Fix screen-on speed during phone call" into rvc-dev am: a0cecdfe am: 8c38a5e4 am: 5e1f5cb3 am: 5963a60b

Change-Id: Ibc8f89f7675d541abe8212ddde53cd9b7b8d2528
parents 0d4b2063 5963a60b
Loading
Loading
Loading
Loading
+16 −6
Original line number Original line Diff line number Diff line
@@ -1067,13 +1067,23 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
                    mColorFadeEnabled && mPowerState.getColorFadeLevel() == 1.0f;
                    mColorFadeEnabled && mPowerState.getColorFadeLevel() == 1.0f;
            final boolean brightnessIsTemporary =
            final boolean brightnessIsTemporary =
                    mAppliedTemporaryBrightness || mAppliedTemporaryAutoBrightnessAdjustment;
                    mAppliedTemporaryBrightness || mAppliedTemporaryAutoBrightnessAdjustment;
            // We only want to animate the brightness if it is between 0.0f and 1.0f.
            // brightnessState can contain the values -1.0f and NaN, which we do not want to
            // animate to. To avoid this, we check the value first.
            // If the brightnessState is off (-1.0f) we still want to animate to the minimum
            // brightness (0.0f) to accommodate for LED displays, which can appear bright to the
            // user even when the display is all black.
            float animateValue = brightnessState == PowerManager.BRIGHTNESS_OFF_FLOAT
                    ? PowerManager.BRIGHTNESS_MIN : brightnessState;
            if (isValidBrightnessValue(animateValue)) {
                if (initialRampSkip || hasBrightnessBuckets
                if (initialRampSkip || hasBrightnessBuckets
                        || wasOrWillBeInVr || !isDisplayContentVisible || brightnessIsTemporary) {
                        || wasOrWillBeInVr || !isDisplayContentVisible || brightnessIsTemporary) {
                animateScreenBrightness(brightnessState, SCREEN_ANIMATION_RATE_MINIMUM);
                    animateScreenBrightness(animateValue, SCREEN_ANIMATION_RATE_MINIMUM);
                } else {
                } else {
                animateScreenBrightness(brightnessState,
                    animateScreenBrightness(animateValue,
                            slowChange ? mBrightnessRampRateSlow : mBrightnessRampRateFast);
                            slowChange ? mBrightnessRampRateSlow : mBrightnessRampRateFast);
                }
                }
            }


            if (!brightnessIsTemporary) {
            if (!brightnessIsTemporary) {
                if (userInitiatedChange && (mAutomaticBrightnessController == null
                if (userInitiatedChange && (mAutomaticBrightnessController == null
+1 −1
Original line number Original line Diff line number Diff line
@@ -146,7 +146,7 @@ final class DisplayPowerState {
    /**
    /**
     * Sets the display brightness.
     * Sets the display brightness.
     *
     *
     * @param brightness The brightness, ranges from 0 (minimum / off) to 255 (brightest).
     * @param brightness The brightness, ranges from 0.0f (minimum / off) to 1.0f (brightest).
     */
     */
    public void setScreenBrightness(float brightness) {
    public void setScreenBrightness(float brightness) {
        if (mScreenBrightness != brightness) {
        if (mScreenBrightness != brightness) {