Merge "Fixed double face auth on swipe" into sc-dev

This commit is contained in:
Joshua Mccloskey
2021-07-19 20:00:57 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 4 deletions

View File

@@ -23,5 +23,6 @@ data class KeyguardFaceListenModel(
val isLockIconPressed: Boolean, val isLockIconPressed: Boolean,
val isScanningAllowedByStrongAuth: Boolean, val isScanningAllowedByStrongAuth: Boolean,
val isPrimaryUser: Boolean, val isPrimaryUser: Boolean,
val isSecureCameraLaunched: Boolean val isSecureCameraLaunched: Boolean,
val isFaceAuthenticated: Boolean
) )

View File

@@ -1058,9 +1058,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|| isSimPinSecure()); || isSimPinSecure());
} }
private boolean getIsFaceAuthenticated() {
boolean faceAuthenticated = false;
BiometricAuthenticated bioFaceAuthenticated = mUserFaceAuthenticated.get(getCurrentUser());
if (bioFaceAuthenticated != null) {
faceAuthenticated = bioFaceAuthenticated.mAuthenticated;
}
return faceAuthenticated;
}
private void requireStrongAuthIfAllLockedOut() { private void requireStrongAuthIfAllLockedOut() {
final boolean faceLock = final boolean faceLock =
mFaceLockedOutPermanent || !shouldListenForFace(); (mFaceLockedOutPermanent || !shouldListenForFace()) && !getIsFaceAuthenticated();
final boolean fpLock = final boolean fpLock =
mFingerprintLockedOutPermanent || !shouldListenForFingerprint(isUdfpsEnrolled()); mFingerprintLockedOutPermanent || !shouldListenForFingerprint(isUdfpsEnrolled());
@@ -2240,6 +2249,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
strongAuthAllowsScanning = false; strongAuthAllowsScanning = false;
} }
// If the face has recently been authenticated do not attempt to authenticate again.
boolean faceAuthenticated = getIsFaceAuthenticated();
// Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
// instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware. // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
final boolean shouldListen = final boolean shouldListen =
@@ -2248,7 +2260,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
&& !mSwitchingUser && !isFaceDisabled(user) && becauseCannotSkipBouncer && !mSwitchingUser && !isFaceDisabled(user) && becauseCannotSkipBouncer
&& !mKeyguardGoingAway && mBiometricEnabledForUser.get(user) && !mLockIconPressed && !mKeyguardGoingAway && mBiometricEnabledForUser.get(user) && !mLockIconPressed
&& strongAuthAllowsScanning && mIsPrimaryUser && strongAuthAllowsScanning && mIsPrimaryUser
&& (!mSecureCameraLaunched || mOccludingAppRequestingFace); && (!mSecureCameraLaunched || mOccludingAppRequestingFace)
&& !faceAuthenticated;
// Aggregate relevant fields for debug logging. // Aggregate relevant fields for debug logging.
if (DEBUG_FACE || DEBUG_SPEW) { if (DEBUG_FACE || DEBUG_SPEW) {
@@ -2269,7 +2282,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
mLockIconPressed, mLockIconPressed,
strongAuthAllowsScanning, strongAuthAllowsScanning,
mIsPrimaryUser, mIsPrimaryUser,
mSecureCameraLaunched); mSecureCameraLaunched,
faceAuthenticated);
maybeLogFaceListenerModelData(model); maybeLogFaceListenerModelData(model);
} }