Merge "Only update biometric state when keyguard is showing" into udc-dev
This commit is contained in:
@@ -2867,7 +2867,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
||||
|| mGoingToSleep
|
||||
|| shouldListenForFingerprintAssistant
|
||||
|| (mKeyguardOccluded && mIsDreaming)
|
||||
|| (mKeyguardOccluded && userDoesNotHaveTrust
|
||||
|| (mKeyguardOccluded && userDoesNotHaveTrust && mKeyguardShowing
|
||||
&& (mOccludingAppRequestingFp || isUdfps || mAlternateBouncerShowing));
|
||||
|
||||
// Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
|
||||
|
||||
@@ -1010,6 +1010,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
||||
assertThat(mKeyguardUpdateMonitor.shouldListenForFingerprint(false)).isFalse();
|
||||
verifyFingerprintAuthenticateNeverCalled();
|
||||
// WHEN alternate bouncer is shown
|
||||
mKeyguardUpdateMonitor.setKeyguardShowing(true, true);
|
||||
mKeyguardUpdateMonitor.setAlternateBouncerShowing(true);
|
||||
|
||||
// THEN make sure FP listening begins
|
||||
@@ -2731,6 +2732,21 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
||||
KeyguardUpdateMonitor.getCurrentUser())).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFingerprintListeningStateWhenOccluded() {
|
||||
when(mAuthController.isUdfpsSupported()).thenReturn(true);
|
||||
|
||||
mKeyguardUpdateMonitor.setKeyguardShowing(false, false);
|
||||
mKeyguardUpdateMonitor.dispatchStartedWakingUp(PowerManager.WAKE_REASON_BIOMETRIC);
|
||||
mKeyguardUpdateMonitor.setKeyguardShowing(false, true);
|
||||
|
||||
verifyFingerprintAuthenticateNeverCalled();
|
||||
|
||||
mKeyguardUpdateMonitor.setKeyguardShowing(true, true);
|
||||
mKeyguardUpdateMonitor.setAlternateBouncerShowing(true);
|
||||
|
||||
verifyFingerprintAuthenticateCall();
|
||||
}
|
||||
|
||||
private void verifyFingerprintAuthenticateNeverCalled() {
|
||||
verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), any());
|
||||
|
||||
Reference in New Issue
Block a user