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

Commit 0930bd0b authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Merge "Do not animate scrim when ColorFade" into pi-dev

am: ee7bc05a

Change-Id: I39f8495223cbd2cda27acc05a64b68815683821d
parents 163b606b ee7bc05a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -112,9 +112,9 @@ public enum ScrimState {
            mCurrentInFrontTint = Color.BLACK;
            mCurrentBehindTint = Color.BLACK;
            mAnimationDuration = ScrimController.ANIMATION_DURATION_LONG;
            // DisplayPowerManager will blank the screen for us, we just need
            // to set our state.
            mAnimateChange = !mDisplayRequiresBlanking;
            // DisplayPowerManager may blank the screen for us,
            // in this case we just need to set our state.
            mAnimateChange = mDozeParameters.shouldControlScreenOff();
        }

        @Override
+15 −1
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ public class ScrimControllerTest extends SysuiTestCase {
    }

    @Test
    public void scrimBlanksBeforeLeavingAoD() {
    public void scrimBlanksBeforeLeavingAod() {
        // Simulate unlock with fingerprint
        mScrimController.transitionTo(ScrimState.AOD);
        mScrimController.finishAnimationsImmediately();
@@ -455,6 +455,20 @@ public class ScrimControllerTest extends SysuiTestCase {
        }
    }

    @Test
    public void testAnimatesTransitionToAod() {
        when(mDozeParamenters.shouldControlScreenOff()).thenReturn(false);
        ScrimState.AOD.prepare(ScrimState.KEYGUARD);
        Assert.assertFalse("No animation when ColorFade kicks in",
                ScrimState.AOD.getAnimateChange());

        reset(mDozeParamenters);
        when(mDozeParamenters.shouldControlScreenOff()).thenReturn(true);
        ScrimState.AOD.prepare(ScrimState.KEYGUARD);
        Assert.assertTrue("Animate scrims when ColorFade won't be triggered",
                ScrimState.AOD.getAnimateChange());
    }

    /**
     * Conserves old notification density after leaving state and coming back.
     *