Don't listen for udfps on lock down or encryption
If the device is encryped or is in lock down, don't show the udfps overlay because the user cannot authenticate from this state anyway. Test: atest KeyguardUpdateMonitorTest Fixes: 183629563 Change-Id: Ie48dfa6bc4a5db0a35be02fd973d982ef3475315
This commit is contained in:
@@ -2113,6 +2113,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
||||
return shouldListenForFingerprint()
|
||||
&& !mBouncer
|
||||
&& !getUserCanSkipBouncer(getCurrentUser())
|
||||
&& !isEncryptedOrLockdown(getCurrentUser())
|
||||
&& mStrongAuthTracker.hasUserAuthenticatedSinceBoot();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user