Cherry-picked "Hide SIM PIN when SIM card is removed" to pi-dev

Bug: 120011429
Test: manually add and remove SIM card
Merged-In: Ied7666c2f6c1febe5690e4531b76b58a4f703d86
Change-Id: Ied7666c2f6c1febe5690e4531b76b58a4f703d86
This commit is contained in:
Lucas Dupin
2018-12-05 20:03:53 -08:00
committed by Brad Ebinger
parent e7d6fcd8cf
commit 0b196c693b
2 changed files with 10 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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;