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

Commit c4ed9b02 authored by Selim Cinek's avatar Selim Cinek Committed by Android Build Coastguard Worker
Browse files

Fixed an issue where using UDFPS always dismissed the shade

Because we were only checking for the bouncer to be shown and not
the alternative auth interceptor, the unlock mode always ended up
being unlock_collapse instead of dismiss_bouncer.
The isBouncerShowing() was already taking into account the alternative
auth path, but the bouncerIsOrWillBeShowing() didn't

Fixes: 204049350
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
Merged-In: Id8bf8460bff26ec5694c82466ea63e3cdf61216e
Change-Id: Id8bf8460bff26ec5694c82466ea63e3cdf61216e
(cherry picked from commit 571fdde9)
parent e90f8647
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -899,7 +899,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb

    @Override
    public boolean bouncerIsOrWillBeShowing() {
        return mBouncer.isShowing() || mBouncer.getShowingSoon();
        return isBouncerShowing() || mBouncer.getShowingSoon();
    }

    public boolean isFullscreenBouncer() {
+20 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
    @Mock
    private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
    @Mock
    private StatusBarKeyguardViewManager.AlternateAuthInterceptor mAlternateAuthInterceptor;
    @Mock
    private KeyguardMessageArea mKeyguardMessageArea;

    private WakefulnessLifecycle mWakefulnessLifecycle;
@@ -286,6 +288,24 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
        verify(cancelAction, never()).run();
    }

    @Test
    public void testShowing_whenAlternateAuthShowing() {
        mStatusBarKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor);
        when(mBouncer.isShowing()).thenReturn(false);
        when(mAlternateAuthInterceptor.isShowingAlternateAuthBouncer()).thenReturn(true);
        assertTrue("Is showing not accurate when alternative auth showing",
                mStatusBarKeyguardViewManager.isShowing());
    }

    @Test
    public void testWillBeShowing_whenAlternateAuthShowing() {
        mStatusBarKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor);
        when(mBouncer.isShowing()).thenReturn(false);
        when(mAlternateAuthInterceptor.isShowingAlternateAuthBouncer()).thenReturn(true);
        assertTrue("Is or will be showing not accurate when alternative auth showing",
                mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing());
    }

    @Test
    public void testUpdateResources_delegatesToBouncer() {
        mStatusBarKeyguardViewManager.updateResources();