From 6ad8c89e75e348d8eb61bb833590c8001338a0bb Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Thu, 7 Jul 2022 10:03:37 -0700 Subject: [PATCH] [Keyguard] Remove behind scrim for alarm When we show the alarm activity, the behind scrim is showing and intercepting the touch. Looking at the scrim state, even though the panel expansion is 0, the behind scrim is a value greater than 1. This is because we are also tracking bouncer hidden fraction in the case the scrim state is UNLOCKED. I believe this case is only relevant to DREAMING. Tracking bouncer hidden fraction only for DREAMING fixes the issue. Test: Manual on device plus a unit test Bug: 232581524 Change-Id: I96542e279c884b313a133ab0a0070b6f0d9e6771 --- .../systemui/statusbar/phone/ScrimController.java | 3 ++- .../systemui/statusbar/phone/ScrimControllerTest.java | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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 0cf9a530afcb7..dba65d1cd2337 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -783,7 +783,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump mInFrontAlpha = 0; } - if (mBouncerHiddenFraction != KeyguardBouncer.EXPANSION_HIDDEN) { + if (mState == ScrimState.DREAMING + && mBouncerHiddenFraction != KeyguardBouncer.EXPANSION_HIDDEN) { final float interpolatedFraction = BouncerPanelExpansionCalculator.aboutToShowBouncerProgress( mBouncerHiddenFraction); 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 837b0453bc9a8..7cd275db1ed6b 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 @@ -1553,6 +1553,15 @@ public class ScrimControllerTest extends SysuiTestCase { mScrimInFront.shouldBlendWithMainColor()); } + @Test + public void applyState_unlocked_bouncerShowing() { + mScrimController.transitionTo(ScrimState.UNLOCKED); + mScrimController.setBouncerHiddenFraction(0.99f); + mScrimController.setRawPanelExpansionFraction(0f); + finishAnimationsImmediately(); + assertScrimAlpha(mScrimBehind, 0); + } + private void assertAlphaAfterExpansion(ScrimView scrim, float expectedAlpha, float expansion) { mScrimController.setRawPanelExpansionFraction(expansion); finishAnimationsImmediately();