diff options
| author | 2022-04-18 17:29:07 +0000 | |
|---|---|---|
| committer | 2022-04-18 20:14:56 +0000 | |
| commit | 99b958d581be5abc4812d6fbf9fb6b31b051928d (patch) | |
| tree | a6ec279730bc323af24b97578936cf9abb97ecdc | |
| parent | d248c68122fdde85125613a55b5c8d1c0d8f9b94 (diff) | |
[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
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java | 6 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 8c1ed19a8dcc..35aee6645289 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -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) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java index ff2c05b04160..dce520c0973d 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java @@ -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(); |