Merge "Clear and re-focus pin password entry field" into udc-dev am: e044f614e7 am: 22140b9d95

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22229495

Change-Id: I1abb26d9d82e3b2f0c9d26651d9052ccaf96096d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alex Stetson
2023-04-03 16:40:03 +00:00
committed by Automerger Merge Worker

View File

@@ -127,6 +127,11 @@ public abstract class KeyguardPinBasedInputViewController<T extends KeyguardPinB
@Override
public void onResume(int reason) {
super.onResume(reason);
// It's possible to reach a state here where mPasswordEntry believes it is focused
// but it is not actually focused. This state will prevent the view from gaining focus,
// as requestFocus will no-op since the focus flag is already set. By clearing focus first,
// it's guaranteed that the view has focus.
mPasswordEntry.clearFocus();
mPasswordEntry.requestFocus();
}