Merge "Don't run faceDetect when fp is locked out" into udc-dev
This commit is contained in:
@@ -2843,7 +2843,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
final boolean supportsDetect = !mFaceSensorProperties.isEmpty()
|
final boolean supportsDetect = !mFaceSensorProperties.isEmpty()
|
||||||
&& mFaceSensorProperties.get(0).supportsFaceDetection
|
&& mFaceSensorProperties.get(0).supportsFaceDetection
|
||||||
&& canBypass && !mPrimaryBouncerIsOrWillBeShowing
|
&& canBypass && !mPrimaryBouncerIsOrWillBeShowing
|
||||||
&& !isUserInLockdown(user);
|
&& !isUserInLockdown(user)
|
||||||
|
&& !isFingerprintLockedOut();
|
||||||
final boolean faceAuthAllowedOrDetectionIsNeeded = faceAuthAllowed || supportsDetect;
|
final boolean faceAuthAllowedOrDetectionIsNeeded = faceAuthAllowed || supportsDetect;
|
||||||
|
|
||||||
// If the face or fp has recently been authenticated do not attempt to authenticate again.
|
// If the face or fp has recently been authenticated do not attempt to authenticate again.
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.android.keyguard;
|
|||||||
|
|
||||||
import static android.app.StatusBarManager.SESSION_KEYGUARD;
|
import static android.app.StatusBarManager.SESSION_KEYGUARD;
|
||||||
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
|
import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
|
||||||
|
import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_TIMED;
|
||||||
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_LOCKOUT;
|
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_LOCKOUT;
|
||||||
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_LOCKOUT_PERMANENT;
|
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ERROR_LOCKOUT_PERMANENT;
|
||||||
import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_POWER_BUTTON;
|
import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_POWER_BUTTON;
|
||||||
@@ -834,6 +835,39 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
verifyFaceDetectNeverCalled();
|
verifyFaceDetectNeverCalled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void noFaceRun_whenFpLockout() {
|
||||||
|
// GIVEN bypass is enabled, face detection is supported and strong auth is required
|
||||||
|
lockscreenBypassIsAllowed();
|
||||||
|
supportsFaceDetection();
|
||||||
|
strongAuthRequiredEncrypted();
|
||||||
|
keyguardIsVisible();
|
||||||
|
// fingerprint is NOT running, UDFPS is NOT supported
|
||||||
|
|
||||||
|
// GIVEN fp is locked out
|
||||||
|
when(mFingerprintManager.getLockoutModeForUser(eq(FINGERPRINT_SENSOR_ID), anyInt()))
|
||||||
|
.thenReturn(BIOMETRIC_LOCKOUT_TIMED);
|
||||||
|
mKeyguardUpdateMonitor.handleUserSwitchComplete(0);
|
||||||
|
assertThat(mKeyguardUpdateMonitor.isFingerprintLockedOut()).isEqualTo(true);
|
||||||
|
|
||||||
|
// WHEN the device wakes up
|
||||||
|
mKeyguardUpdateMonitor.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON);
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
|
// FACE detect is NOT triggered and face authenticate is NOT triggered
|
||||||
|
verifyFaceDetectNeverCalled();
|
||||||
|
verifyFaceAuthenticateNeverCalled();
|
||||||
|
|
||||||
|
// WHEN bouncer becomes visible
|
||||||
|
setKeyguardBouncerVisibility(true);
|
||||||
|
clearInvocations(mFaceManager);
|
||||||
|
|
||||||
|
// THEN face scanning is not run
|
||||||
|
mKeyguardUpdateMonitor.requestFaceAuth(FaceAuthApiRequestReason.UDFPS_POINTER_DOWN);
|
||||||
|
verifyFaceAuthenticateNeverCalled();
|
||||||
|
verifyFaceDetectNeverCalled();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void noFaceDetect_whenStrongAuthRequiredAndBypass_faceDetectionUnsupported() {
|
public void noFaceDetect_whenStrongAuthRequiredAndBypass_faceDetectionUnsupported() {
|
||||||
// GIVEN bypass is enabled, face detection is NOT supported and strong auth is required
|
// GIVEN bypass is enabled, face detection is NOT supported and strong auth is required
|
||||||
|
|||||||
Reference in New Issue
Block a user