Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e0d4959 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Hide SIM PIN when SIM card is removed

Test: manually add and remove SIM card
Change-Id: Ied7666c2f6c1febe5690e4531b76b58a4f703d86
Fixes: 119587536
parent a4418c7e
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1904,14 +1904,19 @@ 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;
            }
        }

        SimData data = mSimDatas.get(subId);
        final boolean changed;
@@ -1925,7 +1930,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) {
+3 −0
Original line number Diff line number Diff line
@@ -488,6 +488,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;