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

Commit 44d2d8f9 authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Update udfps view state before showing" into sc-dev

parents 34555e20 bfcdcea0
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
@@ -451,6 +451,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