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

Commit bd32b245 authored by Sandeep Gutta's avatar Sandeep Gutta
Browse files

MSIM: Fix subId creation issue when one of inserted SIM card state is ERROR

On Dual SIM device, if one slot has one valid SIM card and another
SIM slot inserted with a ERROR SIM card, subId not getting added
for valid SIM.
The reason for this is, SubscriptionInfoUpdater.java is waiting for
ICCID on slot where card state reported as ERROR.

To resolve this issue, assign IccId to empty string when card state ERROR.

Test: Manual

Change-Id: I98156e19c69126c4c98f3800d922e7ec97c07cac
parent 51b3661b
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ public class SubscriptionInfoUpdater extends Handler {
                break;

            case EVENT_SIM_IO_ERROR:
                updateCarrierServices(msg.arg1, IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR);
                handleSimError(msg.arg1);
                break;

            case EVENT_SIM_RESTRICTED:
@@ -515,6 +515,17 @@ public class SubscriptionInfoUpdater extends Handler {
        updateCarrierServices(slotId, IccCardConstants.INTENT_VALUE_ICC_ABSENT);
    }

    private void handleSimError(int slotId) {
        if (mIccId[slotId] != null && !mIccId[slotId].equals(ICCID_STRING_FOR_NO_SIM)) {
            logd("SIM" + (slotId + 1) + " Error ");
        }
        mIccId[slotId] = ICCID_STRING_FOR_NO_SIM;
        if (isAllIccIdQueryDone()) {
            updateSubscriptionInfoByIccId();
        }
        updateCarrierServices(slotId, IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR);
    }

    /**
     * TODO: Simplify more, as no one is interested in what happened
     * only what the current list contains.