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

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

Merge "Don't listen for udfps on lock down or encryption" into sc-dev

parents 5b5c629a ceeacda5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2113,6 +2113,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        return shouldListenForFingerprint()
                && !mBouncer
                && !getUserCanSkipBouncer(getCurrentUser())
                && !isEncryptedOrLockdown(getCurrentUser())
                && mStrongAuthTracker.hasUserAuthenticatedSinceBoot();
    }

+15 −0
Original line number Diff line number Diff line
@@ -910,6 +910,21 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
        assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(false);
    }

    @Test
    public void testShouldNotListenForUdfps_whenInLockDown() {
        // GIVEN a "we should listen for udfps" state
        setKeyguardBouncerVisibility(false /* isVisible */);
        mStatusBarStateListener.onStateChanged(StatusBarState.KEYGUARD);
        when(mStrongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true);

        // WHEN device in lock down
        when(mStrongAuthTracker.getStrongAuthForUser(anyInt())).thenReturn(
                KeyguardUpdateMonitor.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN);

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

    @Test
    public void testRequireUnlockForNfc_Broadcast() {
        KeyguardUpdateMonitorCallback callback = mock(KeyguardUpdateMonitorCallback.class);