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

Commit 525130aa authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Changes to not use getFullIccId in SubscriptionInfo.

getFullIccId includes hex chars in the ICCID, making it appear
as if its a new ICCID and thus SubscriptionInfo generates new subId
even for SIMs already known to the device (on first upgrading to N).

Bug: 28773363
Change-Id: I4d262d69c3042bef9e711935e02942ec3667171f
parent 0a0852c2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ public class SubscriptionInfoUpdater extends Handler {
                if (ar.exception == null) {
                    if (ar.result != null) {
                        byte[] data = (byte[])ar.result;
                        mIccId[slotId] = IccUtils.bchToString(data, 0, data.length);
                        mIccId[slotId] = IccUtils.bcdToString(data, 0, data.length);
                    } else {
                        logd("Null ar");
                        mIccId[slotId] = ICCID_STRING_FOR_NO_SIM;
@@ -364,11 +364,11 @@ public class SubscriptionInfoUpdater extends Handler {
            logd("onRecieve: IccRecords null");
            return;
        }
        if (records.getFullIccId() == null) {
        if (records.getIccId() == null) {
            logd("onRecieve: IccID null");
            return;
        }
        mIccId[slotId] = records.getFullIccId();
        mIccId[slotId] = records.getIccId();

        if (isAllIccIdQueryDone()) {
            updateSubscriptionInfoByIccId();
+2 −2
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest {
        /* mock new sim got loaded and there is no sim loaded before */
        doReturn(null).when(mSubscriptionController)
                .getSubInfoUsingSlotIdWithCheck(eq(0), anyBoolean(), anyString());
        doReturn("89012604200000000000").when(mIccRecord).getFullIccId();
        doReturn("89012604200000000000").when(mIccRecord).getIccId();
        doReturn(FAKE_PLMN).when(mTelephonyManager).getSimOperatorNumericForPhone(0);
        Intent mIntent = new Intent(IccCardProxy.ACTION_INTERNAL_SIM_STATE_CHANGED);
        mIntent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE,
@@ -246,7 +246,7 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest {
        /* mock new sim got loaded and there is no sim loaded before */
        doReturn(null).when(mSubscriptionController)
                .getSubInfoUsingSlotIdWithCheck(eq(0), anyBoolean(), anyString());
        doReturn("89012604200000000000").when(mIccRecord).getFullIccId();
        doReturn("89012604200000000000").when(mIccRecord).getIccId();
        // operator numeric is empty
        doReturn("").when(mTelephonyManager).getSimOperatorNumericForPhone(0);
        Intent mIntent = new Intent(IccCardProxy.ACTION_INTERNAL_SIM_STATE_CHANGED);