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

Commit 99b958d5 authored by Aaron Liu's avatar Aaron Liu
Browse files

[Scrim] Remove notif scrim flicker on unlock

We just keep notif scrim alpha to 0 when we are on keyguard and we are
not transitioning to full shade. This will prevent the notification
shade from showing when tracking on the lockscreen.

Bug: 201040592
Test: Manual on devices of multiple form factors:
	Launch notif from LS - portrait and landscape
	Launch UserSwitcher From LS - portrait and landscape
	Show pin bouncer in LS
	Swipe to unlock - portrait and landscape

Change-Id: I0cfa7cd40b69c5c9ea7eeb708f1a073f307918cb
parent d248c681
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -850,7 +850,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
            // At the end of a launch animation over the lockscreen, the state is either KEYGUARD or
            // SHADE_LOCKED and this code is called. We have to set the notification alpha to 0
            // otherwise there is a flicker to its previous value.
            if (mKeyguardOccluded) {
            boolean hideNotificationScrim = (mState == ScrimState.KEYGUARD
                    && mTransitionToFullShadeProgress == 0
                    && mQsExpansion == 0
                    && !mClipsQsScrim);
            if (mKeyguardOccluded || hideNotificationScrim) {
                mNotificationsAlpha = 0;
            }
            if (mUnOcclusionAnimationRunning && mState == ScrimState.KEYGUARD) {
+12 −0
Original line number Diff line number Diff line
@@ -1270,6 +1270,7 @@ public class ScrimControllerTest extends SysuiTestCase {
    @Test
    public void notificationAlpha_unnocclusionAnimating_bouncerActive_usesKeyguardNotifAlpha() {
        when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(true);
        mScrimController.setClipsQsScrim(true);

        mScrimController.transitionTo(ScrimState.KEYGUARD);
        mScrimController.setUnocclusionAnimationRunning(true);
@@ -1312,6 +1313,7 @@ public class ScrimControllerTest extends SysuiTestCase {
    @Test
    public void notificationAlpha_inKeyguardState_bouncerActive_usesInvertedBouncerInterpolator() {
        when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(true);
        mScrimController.setClipsQsScrim(true);

        mScrimController.transitionTo(ScrimState.KEYGUARD);

@@ -1331,6 +1333,7 @@ public class ScrimControllerTest extends SysuiTestCase {
    @Test
    public void notificationAlpha_inKeyguardState_bouncerNotActive_usesInvertedShadeInterpolator() {
        when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(false);
        mScrimController.setClipsQsScrim(true);

        mScrimController.transitionTo(ScrimState.KEYGUARD);

@@ -1478,6 +1481,15 @@ public class ScrimControllerTest extends SysuiTestCase {
                mNotificationsScrim, TRANSPARENT));
    }

    @Test
    public void notificationAlpha_inKeyguardState_bouncerNotActive_clipsQsScrimFalse() {
        mScrimController.setClipsQsScrim(false);
        mScrimController.transitionTo(ScrimState.KEYGUARD);

        float expansion = 0.8f;
        assertAlphaAfterExpansion(mNotificationsScrim, 0f, expansion);
    }

    private void assertAlphaAfterExpansion(ScrimView scrim, float expectedAlpha, float expansion) {
        mScrimController.setRawPanelExpansionFraction(expansion);
        finishAnimationsImmediately();