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

Commit 34d642a9 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Update udfps view state before showing" into sc-dev am: 44d2d8f9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13816412

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie84c8d7f40f6ab11f959bfeb087d730cc5728779
parents 30e6dc20 44d2d8f9
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