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

Commit ee7bc05a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents d1bc30a4 ea0116ea
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.
     *