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

Commit 6ad8c89e authored by Aaron Liu's avatar Aaron Liu
Browse files

[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
parent 91079f44
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -783,7 +783,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
                mInFrontAlpha = 0;
                mInFrontAlpha = 0;
            }
            }


            if (mBouncerHiddenFraction != KeyguardBouncer.EXPANSION_HIDDEN) {
            if (mState == ScrimState.DREAMING
                    && mBouncerHiddenFraction != KeyguardBouncer.EXPANSION_HIDDEN) {
                final float interpolatedFraction =
                final float interpolatedFraction =
                        BouncerPanelExpansionCalculator.aboutToShowBouncerProgress(
                        BouncerPanelExpansionCalculator.aboutToShowBouncerProgress(
                                mBouncerHiddenFraction);
                                mBouncerHiddenFraction);
+9 −0
Original line number Original line Diff line number Diff line
@@ -1553,6 +1553,15 @@ public class ScrimControllerTest extends SysuiTestCase {
                mScrimInFront.shouldBlendWithMainColor());
                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) {
    private void assertAlphaAfterExpansion(ScrimView scrim, float expectedAlpha, float expansion) {
        mScrimController.setRawPanelExpansionFraction(expansion);
        mScrimController.setRawPanelExpansionFraction(expansion);
        finishAnimationsImmediately();
        finishAnimationsImmediately();