From 3b8d608267dbde7bf8464710374c2fd6fb179bf3 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Mon, 12 Jul 2021 12:56:21 -0400 Subject: [PATCH] SIM PIN unlock - Keyguard in invalid state It is possible to get SIM events out of order, due to KeyguardSIMPINController proactively settings the SIM state to READY. We may also get a callback from the Telephony SubscriptionManager notifying us of a state change, which can make the Keyguard think the SIM state is LOCKED. If this happens fast enough, we will show the SIM PIN screen twice, and the keyguard gets the state confused due to the new unlock animation delaying the state change. Bug: 191927891 Test: manual, enter SIM and unlock many times Change-Id: Ib27a199d3cdd8a22af27ee74a147a89fa72281ac --- .../com/android/systemui/keyguard/KeyguardViewMediator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 75f77bffa4a0c..c33f4fa8dee42 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -1506,8 +1506,10 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, return; } - // if the keyguard is already showing, don't bother - if (mKeyguardViewControllerLazy.get().isShowing()) { + // if the keyguard is already showing, don't bother. check flags in both files + // to account for the hiding animation which results in a delay and discrepancy + // between flags + if (mShowing && mKeyguardViewControllerLazy.get().isShowing()) { if (DEBUG) Log.d(TAG, "doKeyguard: not showing because it is already showing"); resetStateLocked(); return;