Cherry-picked "Hide SIM PIN when SIM card is removed" to pi-dev
am: 0b196c693b
Change-Id: If62b7f613edbef742a08eb0f25d45dfe245fda2f
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user