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

Commit c43e240f authored by Lucas Dupin's avatar Lucas Dupin Committed by Christian Göllner
Browse files

Fix scrims not fading in

If the keyguard dismissal animation finishes before the last panel
expansion event, the expansion would never be propagated to the bouncer,
causing it to be stuck in transit forever.

Test: manual with udfps
Test: atest StatusBarKeyguardViewManagerTest
Fixes: 228048755
Fixes: 230195693
Bug: 228361057
Change-Id: I8167b8ab534f2c7e5676d9f2a9f0199f8b952f83
parent 57edb1f7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -390,6 +390,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                    && !mBouncer.isShowing() && !mBouncer.isAnimatingAway()) {
                mBouncer.show(false /* resetSecuritySelection */, false /* scrimmed */);
            }
        } else if (!mShowing && mBouncer.inTransit()) {
            // Keyguard is not visible anymore, but expansion animation was still running.
            // We need to keep propagating the expansion state to the bouncer, otherwise it will be
            // stuck in transit.
            mBouncer.setExpansion(fraction);
        } else if (mPulsing && fraction == KeyguardBouncer.EXPANSION_VISIBLE) {
            // Panel expanded while pulsing but didn't translate the bouncer (because we are
            // unlocked.) Let's simply wake-up to dismiss the lock screen.
+9 −0
Original line number Diff line number Diff line
@@ -191,6 +191,15 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
        verify(mBouncer).setExpansion(eq(0.5f));
    }

    @Test
    public void onPanelExpansionChanged_propagatesToBouncer_evenAfterHidden() {
        mStatusBarKeyguardViewManager.hide(0, 0);
        when(mBouncer.inTransit()).thenReturn(true);

        mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
        verify(mBouncer).setExpansion(eq(EXPANSION_EVENT.getFraction()));
    }

    @Test
    public void onPanelExpansionChanged_showsBouncerWhenSwiping() {
        when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false);