Merge "Fixed double face auth on swipe" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4438cf6799
@@ -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
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user