From 0ef11ebaa98622761774ac4e20062f5ff91e5c0b Mon Sep 17 00:00:00 2001 From: Beverly Date: Wed, 30 Jun 2021 11:49:17 -0400 Subject: [PATCH] Recommend using fp for auth Instead of showing face error msg Test: manual Fixes: 188022390 Change-Id: I05dcac4d4aec511224bb8c33b96c1846c9b8e2e2 --- .../KeyguardIndicationController.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index c09f98dd609f6..ab86fea029ad1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -886,7 +886,10 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal return; } - if (biometricSourceType == BiometricSourceType.FACE && shouldSuppressFaceMsg()) { + if (biometricSourceType == BiometricSourceType.FACE + && shouldSuppressFaceMsgAndShowTryFingerprintMsg()) { + // suggest trying fingerprint + showTransientIndication(R.string.keyguard_try_fingerprint); return; } @@ -913,6 +916,12 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal if (shouldSuppressBiometricError(msgId, biometricSourceType, mKeyguardUpdateMonitor)) { return; } + if (biometricSourceType == BiometricSourceType.FACE + && shouldSuppressFaceMsgAndShowTryFingerprintMsg()) { + // suggest trying fingerprint + showTransientIndication(R.string.keyguard_try_fingerprint); + return; + } if (msgId == FaceManager.FACE_ERROR_TIMEOUT) { // The face timeout message is not very actionable, let's ask the user to // manually retry. @@ -958,18 +967,16 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal || 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 // requested by the user. - return mKeyguardUpdateMonitor.isUdfpsEnrolled() - && mKeyguardUpdateMonitor.isFingerprintDetectionRunning() - && !mKeyguardUpdateMonitor.isFaceAuthUserRequested(); + return mKeyguardUpdateMonitor.isFingerprintDetectionRunning() + && !mKeyguardUpdateMonitor.isFaceAuthUserRequested() + && mKeyguardUpdateMonitor.isUnlockingWithBiometricAllowed( + true /* isStrongBiometric */); } 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 // 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