diff options
| author | 2024-11-26 15:01:45 +0000 | |
|---|---|---|
| committer | 2024-11-26 15:07:20 +0000 | |
| commit | a3eacb59cf563dcf97a4669cf902f984d8efb399 (patch) | |
| tree | 627c599ea5811dd2f3b17148000bfe2eed32b4c3 | |
| parent | 312a7a089b9d51c4952f5ae6b3948ddc1370dbff (diff) | |
Don't invalidate sim data when indexing by slot id
This isn't necessary any longer, as ids will not be in
conflict.
Fixes: 380843477
Test: atest KeyguardUpdateMonitorTest
Flag: com.android.systemui.sim_pin_use_slot_id
Change-Id: I5be82e866f9a8e07f29188065be4591c933e055a
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 2c8fff83a821..fd796f657e11 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -101,6 +101,7 @@ import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener; import android.telephony.TelephonyCallback; import android.telephony.TelephonyManager; import android.text.TextUtils; +import android.util.Log; import android.util.SparseArray; import android.util.SparseBooleanArray; @@ -643,6 +644,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } else { data = mSimDatas.get(changedSubscriptions.get(i).getSubscriptionId()); } + if (data == null) { + Log.w(TAG, "Null SimData for subscription: " + + changedSubscriptions.get(i)); + continue; + } for (int j = 0; j < mCallbacks.size(); j++) { var cb = mCallbacks.get(j).get(); if (cb != null) { @@ -3415,6 +3421,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab * Removes all valid subscription info from the map for the given slotId. */ private void invalidateSlot(int slotId) { + if (simPinUseSlotId()) { + return; + } synchronized (mSimDataLockObject) { var iter = simPinUseSlotId() ? mSimDatasBySlotId.entrySet().iterator() : mSimDatas.entrySet().iterator(); @@ -3446,7 +3455,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab || state == TelephonyManager.SIM_STATE_CARD_IO_ERROR) { updateTelephonyCapable(true); } - invalidateSlot(slotId); } @@ -3966,10 +3974,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private boolean refreshSimState(int subId, int slotId) { int state = mTelephonyManager.getSimState(slotId); synchronized (mSimDataLockObject) { - SimData data = simPinUseSlotId() ? mSimDatasBySlotId.get(slotId) : mSimDatas.get(subId); if (!SubscriptionManager.isValidSubscriptionId(subId)) { invalidateSlot(slotId); } + SimData data = simPinUseSlotId() ? mSimDatasBySlotId.get(slotId) : mSimDatas.get(subId); final boolean changed; if (data == null) { |