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

This commit is contained in:
Beverly Tai
2021-04-02 16:00:44 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 0 deletions

View File

@@ -2113,6 +2113,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
return shouldListenForFingerprint()
&& !mBouncer
&& !getUserCanSkipBouncer(getCurrentUser())
&& !isEncryptedOrLockdown(getCurrentUser())
&& mStrongAuthTracker.hasUserAuthenticatedSinceBoot();
}

View File

@@ -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);