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

Commit 02b5d834 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Always query ICCID from Uicc for locked SIM.

Do not use the cached value in SubscriptionInfoUpdater
which can be stale.

Test: basic sanity, verified by QA
Bug: 153753453
Change-Id: Ib46138acd63233332d300b2210bf7634f1da1868
Merged-in: Ib46138acd63233332d300b2210bf7634f1da1868
(cherry picked from commit e41d70fc)
parent bc00c507
Loading
Loading
Loading
Loading
+14 −19
Original line number Diff line number Diff line
@@ -387,8 +387,6 @@ public class SubscriptionInfoUpdater extends Handler {
            sIccId[phoneId] = null;
        }

        String iccId = sIccId[phoneId];
        if (iccId == null) {
        IccCard iccCard = PhoneFactory.getPhone(phoneId).getIccCard();
        if (iccCard == null) {
            logd("handleSimLocked: IccCard null");
@@ -404,9 +402,6 @@ public class SubscriptionInfoUpdater extends Handler {
            return;
        }
        sIccId[phoneId] = IccUtils.stripTrailingFs(records.getFullIccId());
        } else {
            logd("NOT Querying IccId its already set sIccid[" + phoneId + "]=" + iccId);
        }

        updateSubscriptionInfoByIccId(phoneId, true /* updateEmbeddedSubs */);

+2 −1
Original line number Diff line number Diff line
@@ -497,7 +497,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest {
    @Test
    @SmallTest
    public void testSimLockWithIccId() throws Exception {
        /* no need for IccId query */
        // ICCID will be queried even if it is already available
        doReturn("98106240020000000000").when(mIccRecord).getFullIccId();

        replaceInstance(SubscriptionInfoUpdater.class, "sIccId", null,
                new String[]{"89012604200000000000"});