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

Commit 82c07164 authored by kazerine's avatar kazerine Committed by Bruno Martins
Browse files

Revert "Apply front scrim to doze pulsing"

This reverts commit d424e202.

Change-Id: Ia3bdfc8a317f8d8ffb13f05fddeb21edb87cf44f
parent 71e6d97d
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -455,11 +455,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
            if (mDarkenWhileDragging) {
                mCurrentBehindAlpha = MathUtils.lerp(GRADIENT_SCRIM_ALPHA_BUSY, alphaBehind,
                        interpolatedFract);
                mCurrentInFrontAlpha = mState.getFrontAlpha();
                mCurrentInFrontAlpha = 0;
            } else {
                mCurrentBehindAlpha = MathUtils.lerp(0 /* start */, alphaBehind,
                        interpolatedFract);
                mCurrentInFrontAlpha = mState.getFrontAlpha();
                mCurrentInFrontAlpha = 0;
            }
            mCurrentBehindTint = ColorUtils.blendARGB(ScrimState.BOUNCER.getBehindTint(),
                    mState.getBehindTint(), interpolatedFract);
@@ -485,14 +485,13 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
     * device is dozing when the light sensor is on.
     */
    public void setAodFrontScrimAlpha(float alpha) {
        if (((mState == ScrimState.AOD && mDozeParameters.getAlwaysOn())
                || mState == ScrimState.PULSING) && mCurrentInFrontAlpha != alpha) {
        if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn()
                && mCurrentInFrontAlpha != alpha) {
            mCurrentInFrontAlpha = alpha;
            updateScrims();
        }

        mState.AOD.setAodFrontScrimAlpha(alpha);
        mState.PULSING.setAodFrontScrimAlpha(alpha);
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ public enum ScrimState {
    PULSING(5) {
        @Override
        public void prepare(ScrimState previousState) {
            mCurrentInFrontAlpha = mAodFrontScrimAlpha;
            mCurrentInFrontAlpha = 0;
            mCurrentBehindTint = Color.BLACK;
            mCurrentInFrontTint = Color.BLACK;
            mBlankScreen = mDisplayRequiresBlanking;
+2 −12
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ public class ScrimControllerTest extends SysuiTestCase {
    }

    @Test
    public void transitionToPulsing_withFrontAlphaUpdates() {
    public void transitionToPulsing() {
        // Pre-condition
        // Need to go to AoD first because PULSING doesn't change
        // the back scrim opacity - otherwise it would hide AoD wallpapers.
@@ -233,20 +233,10 @@ public class ScrimControllerTest extends SysuiTestCase {
        assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE);
        assertScrimTint(mScrimBehind, true /* tinted */);

        // ... and when ambient goes dark, front scrim should be semi-transparent
        mScrimController.setAodFrontScrimAlpha(0.5f);
        mScrimController.finishAnimationsImmediately();
        // Front scrim should be semi-transparent
        assertScrimVisibility(VISIBILITY_SEMI_TRANSPARENT /* front */,
                VISIBILITY_FULLY_OPAQUE /* back */);

        mScrimController.setWakeLockScreenSensorActive(true);
        mScrimController.finishAnimationsImmediately();
        assertScrimVisibility(VISIBILITY_SEMI_TRANSPARENT /* front */,
        assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT /* front */,
                VISIBILITY_SEMI_TRANSPARENT /* back */);

        // Reset value since enums are static.
        mScrimController.setAodFrontScrimAlpha(0f);
    }

    @Test