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

Commit bfcdcea0 authored by Beverly's avatar Beverly
Browse files

Update udfps view state before showing

Also continue to listen for fingerprints on shade and fullscreen user
switcher, logic to hide icon is in UdfpsAnimationView

Test: manual
Fixes: 181573493
Change-Id: I7e7aed339498bb5cac588bb67f432251a93638a5
parent d6209d4e
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2077,8 +2077,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    boolean shouldListenForUdfps() {
        return shouldListenForFingerprint()
                && !mBouncer
                && mStatusBarState != StatusBarState.SHADE_LOCKED
                && mStatusBarState != StatusBarState.FULLSCREEN_USER_SWITCHER
                && mStrongAuthTracker.hasUserAuthenticatedSinceBoot();
    }

+1 −0
Original line number Diff line number Diff line
@@ -404,6 +404,7 @@ public class UdfpsController implements DozeReceiver, HbmCallback {

                    mStatusBar.addExpansionChangedListener(mStatusBarExpansionListener);
                    mStatusBarStateController.addCallback(mStatusBarStateListener);
                    mStatusBarStateListener.onStateChanged(mStatusBarStateController.getState());

                    mWindowManager.addView(mView, computeLayoutParams(animation));
                    mView.setOnTouchListener(mOnTouchListener);
+0 −30
Original line number Diff line number Diff line
@@ -792,36 +792,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
        assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(true);
    }

    @Test
    public void testStartUdfpsServiceOnShadeLocked() {
        // GIVEN
        // - bouncer isn't showing
        // - user has authenticated since boot
        setKeyguardBouncerVisibility(false /* isVisible */);
        when(mStrongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true);

        // WHEN the status bar state changes to SHADE_LOCKED
        mStatusBarStateListener.onStateChanged(StatusBarState.SHADE_LOCKED);

        // THEN we shouldn't listen for udfps
        assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(false);
    }

    @Test
    public void testStartUdfpsServiceOnFullscreenUserSwitcher() {
        // GIVEN
        // - bouncer isn't showing
        // - user has authenticated since boot
        setKeyguardBouncerVisibility(false /* isVisible */);
        when(mStrongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true);

        // WHEN the status bar state changes to FULLSCREEN_USER_SWITCHER
        mStatusBarStateListener.onStateChanged(StatusBarState.FULLSCREEN_USER_SWITCHER);

        // THEN we shouldn't listen for udfps
        assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(false);
    }

    @Test
    public void testStartUdfpsServiceNoAuthenticationSinceLastBoot() {
        // GIVEN