From 79079e8a33a082e04e353d9cbb59ab2b415be1d9 Mon Sep 17 00:00:00 2001 From: Beverly Date: Fri, 12 Nov 2021 10:32:53 -0500 Subject: [PATCH] Don't show 'try fingerprint' msg on face auth help Sometimes multiple biometric-help suggestions for face auth can be sent right before a face auth sucesss. If udfps is suppressing the face auth help message, don't show any messages (previouosly we'd show "try fingerprint" which was unhelpful and sometimes was shown on screen as a successful face auth was occurring which was confusing). Note: we will continue to announce the help messages for a11y purposes. Test: atest KeyguardIndicationControllerTest Test: manually auth with face, see keyguard message Fixes: 203897784 Change-Id: I75b9e19b812505ff2dafa960600da67135448042 --- .../systemui/statusbar/KeyguardIndicationController.java | 6 +++++- .../statusbar/KeyguardIndicationControllerTest.java | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index 1c0088709f14a..ed36a27fcb350 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -912,7 +912,11 @@ public class KeyguardIndicationController { } else if (mKeyguardUpdateMonitor.isScreenOn()) { if (biometricSourceType == BiometricSourceType.FACE && shouldSuppressFaceMsgAndShowTryFingerprintMsg()) { - showTryFingerprintMsg(msgId, helpString); + // don't show any help messages, b/c they can come in right before a success + // However, continue to announce help messages for a11y + if (!TextUtils.isEmpty(helpString)) { + mLockScreenIndicationView.announceForAccessibility(helpString); + } return; } showTransientIndication(helpString, false /* isError */, showActionToUnlock); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java index cb0d87a20f894..8afefde866324 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java @@ -710,8 +710,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_RECOGNIZED, faceHelpMsg, BiometricSourceType.FACE); - // THEN "try fingerprint" message appears (and not the face help message) - verifyTransientMessage(mKeyguardTryFingerprintMsg); + // THEN no help message appears + verify(mRotateTextViewController, never()).showTransient(anyString()); // THEN the face help message is still announced for a11y verify(mIndicationAreaBottom).announceForAccessibility(eq(faceHelpMsg));