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

Commit ea0116ea authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Do not animate scrim when ColorFade

AOD scrims should only animate when sysui will control the screen-off
transition.

Test: manual
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
Bug: 77539750
Change-Id: Iba79ea09c149068e75163fabddd3608254dd83f3
parent d7c44eb2
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.
     *