From 41c58ce8ec7cf4d3ed460c198430c347fb9a68a1 Mon Sep 17 00:00:00 2001
From: Chandru S <chandruis@google.com>
Date: Tue, 1 Aug 2023 17:35:21 -0700
Subject: [PATCH] Fixes issue with wrong pin input message not being shown

This chain of calls lead us to reset the primary auth error message because we assume that the user has started entering their primary auth again.

KeyguardPinBasedInputView#resetPasswordText -> PasswordTextView#reset -> PasswordTextView#userActivity() -> UserActivityListener#onUserActivity -> KeyguardAbsKeyInputViewController#onUserInput -> KeyguardSecurityCallback#onUserInput -> BouncerMessageInteractor#onPrimaryBouncerUserInput()

This fix invokes the resetPasswordText before we invoke `reportUnlockAttempt` so that the primary auth error message doesn't get cleared out


Fixes: 293475939
Test: verified manually
Change-Id: Ie7c144bf96cc542d9aae11c255394bd9ca10f2a0
---
 .../com/android/keyguard/KeyguardAbsKeyInputViewController.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
index bb112175ded7b..b81e08183cdc4 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
@@ -178,6 +178,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
                 getKeyguardSecurityCallback().dismiss(true, userId, getSecurityMode());
             }
         } else {
+            mView.resetPasswordText(true /* animate */, false /* announce deletion if no match */);
             if (isValidPassword) {
                 getKeyguardSecurityCallback().reportUnlockAttempt(userId, false, timeoutMs);
                 if (timeoutMs > 0) {
@@ -186,7 +187,6 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
                     handleAttemptLockout(deadline);
                 }
             }
-            mView.resetPasswordText(true /* animate */, false /* announce deletion if no match */);
             if (timeoutMs == 0) {
                 mMessageAreaController.setMessage(mView.getWrongPasswordStringId());
             }
-- 
GitLab