Merge "Recommend using fp for auth" into sc-dev
This commit is contained in:
@@ -882,7 +882,10 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biometricSourceType == BiometricSourceType.FACE && shouldSuppressFaceMsg()) {
|
if (biometricSourceType == BiometricSourceType.FACE
|
||||||
|
&& shouldSuppressFaceMsgAndShowTryFingerprintMsg()) {
|
||||||
|
// suggest trying fingerprint
|
||||||
|
showTransientIndication(R.string.keyguard_try_fingerprint);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -909,6 +912,12 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal
|
|||||||
if (shouldSuppressBiometricError(msgId, biometricSourceType, mKeyguardUpdateMonitor)) {
|
if (shouldSuppressBiometricError(msgId, biometricSourceType, mKeyguardUpdateMonitor)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (biometricSourceType == BiometricSourceType.FACE
|
||||||
|
&& shouldSuppressFaceMsgAndShowTryFingerprintMsg()) {
|
||||||
|
// suggest trying fingerprint
|
||||||
|
showTransientIndication(R.string.keyguard_try_fingerprint);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (msgId == FaceManager.FACE_ERROR_TIMEOUT) {
|
if (msgId == FaceManager.FACE_ERROR_TIMEOUT) {
|
||||||
// The face timeout message is not very actionable, let's ask the user to
|
// The face timeout message is not very actionable, let's ask the user to
|
||||||
// manually retry.
|
// manually retry.
|
||||||
@@ -954,18 +963,16 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal
|
|||||||
|| msgId == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED);
|
|| msgId == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldSuppressFaceMsg() {
|
private boolean shouldSuppressFaceMsgAndShowTryFingerprintMsg() {
|
||||||
// For dual biometric, don't show face auth messages unless face auth was explicitly
|
// For dual biometric, don't show face auth messages unless face auth was explicitly
|
||||||
// requested by the user.
|
// requested by the user.
|
||||||
return mKeyguardUpdateMonitor.isUdfpsEnrolled()
|
return mKeyguardUpdateMonitor.isFingerprintDetectionRunning()
|
||||||
&& mKeyguardUpdateMonitor.isFingerprintDetectionRunning()
|
&& !mKeyguardUpdateMonitor.isFaceAuthUserRequested()
|
||||||
&& !mKeyguardUpdateMonitor.isFaceAuthUserRequested();
|
&& mKeyguardUpdateMonitor.isUnlockingWithBiometricAllowed(
|
||||||
|
true /* isStrongBiometric */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldSuppressFaceError(int msgId, KeyguardUpdateMonitor updateMonitor) {
|
private boolean shouldSuppressFaceError(int msgId, KeyguardUpdateMonitor updateMonitor) {
|
||||||
if (shouldSuppressFaceMsg()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Only checking if unlocking with Biometric is allowed (no matter strong or non-strong
|
// Only checking if unlocking with Biometric is allowed (no matter strong or non-strong
|
||||||
// as long as primary auth, i.e. PIN/pattern/password, is not required), so it's ok to
|
// as long as primary auth, i.e. PIN/pattern/password, is not required), so it's ok to
|
||||||
// pass true for isStrongBiometric to isUnlockingWithBiometricAllowed() to bypass the
|
// pass true for isStrongBiometric to isUnlockingWithBiometricAllowed() to bypass the
|
||||||
|
|||||||
Reference in New Issue
Block a user