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

Commit 909b9acc authored by yinxu's avatar yinxu
Browse files

Update the card state and iccid for active slot

Even when the slot is active, we still need to update the card state and
iccid when receiving the slot status change.

Bug: 78250718
Test: Unit Test
Change-Id: I63470c7c5952f52fabd414a8d957224413386506
parent efeba18b
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ public class UiccSlot extends Handler {
                log("update: radioState=" + radioState + " mLastRadioState=" + mLastRadioState);
            }

            if (oldState != CardState.CARDSTATE_ABSENT
            if ((oldState != CardState.CARDSTATE_ABSENT || mUiccCard != null)
                    && mCardState == CardState.CARDSTATE_ABSENT) {
                // No notifications while radio is off or we just powering up
                if (radioState == RadioState.RADIO_ON && mLastRadioState == RadioState.RADIO_ON) {
@@ -146,6 +146,9 @@ public class UiccSlot extends Handler {
        if (DBG) log("slotStatus update: " + iss.toString());
        synchronized (mLock) {
            mCi = ci;
            parseAtr(iss.atr);
            mCardState = iss.cardState;
            mIccId = iss.iccid;
            if (iss.slotState == IccSlotStatus.SlotState.SLOTSTATE_INACTIVE) {
                if (mActive) {
                    mActive = false;
@@ -154,17 +157,8 @@ public class UiccSlot extends Handler {
                    if (mUiccCard != null) mUiccCard.dispose();
                    nullifyUiccCard(true /* sim state is unknown */);
                }
                parseAtr(iss.atr);
                mCardState = iss.cardState;
                mIccId = iss.iccid;
            } else if (!mActive && iss.slotState == IccSlotStatus.SlotState.SLOTSTATE_ACTIVE) {
                mActive = true;
                parseAtr(iss.atr);
                // todo - ignoring these fields for now; relying on sim state changed to update
                // these
                //      iss.cardState;
                //      iss.iccid;
                //      iss.logicalSlotIndex;
            }
        }
    }