diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 6d5d1a38fd560..241184e6da812 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -1573,13 +1573,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { + slotId + ", state=" + state +")"); } + boolean becameAbsent = false; if (!SubscriptionManager.isValidSubscriptionId(subId)) { Log.w(TAG, "invalid subId in handleSimStateChange()"); /* Only handle No SIM(ABSENT) due to handleServiceStateChange() handle other case */ if (state == State.ABSENT) { updateTelephonyCapable(true); + // Even though the subscription is not valid anymore, we need to notify that the + // SIM card was removed so we can update the UI. + becameAbsent = true; + } else { + return; } - return; } SimData data = mSimDatas.get(subId); @@ -1594,7 +1599,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { data.subId = subId; data.slotId = slotId; } - if (changed && state != State.UNKNOWN) { + if ((changed || becameAbsent) && state != State.UNKNOWN) { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 33db2c8bc16fb..01c6df9dc512a 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -468,6 +468,9 @@ public class KeyguardViewMediator extends SystemUI { // MVNO SIMs can become transiently NOT_READY when switching networks, // so we should only lock when they are ABSENT. onSimAbsentLocked(); + if (simWasLocked) { + resetStateLocked(); + } } } break;