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

Commit 7dae182f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Create UiccCard when mUiccCard is null and mCardState is not ABSENT" into pi-dev

parents c09a6a7d de72f773
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -76,9 +76,11 @@ public class UiccSlot extends Handler {
     * Update slot. The main trigger for this is a change in the ICC Card status.
     */
    public void update(CommandsInterface ci, IccCardStatus ics, int phoneId) {
        if (DBG) log("cardStatus update: " + ics.toString());
        synchronized (mLock) {
            CardState oldState = mCardState;
            mCardState = ics.mCardState;
            mIccId = ics.iccid;
            mPhoneId = phoneId;
            parseAtr(ics.atr);
            mCi = ci;
@@ -104,8 +106,12 @@ public class UiccSlot extends Handler {
                    mUiccCard.dispose();
                    mUiccCard = null;
                }
            } else if ((oldState == null || oldState == CardState.CARDSTATE_ABSENT)
                    && mCardState != CardState.CARDSTATE_ABSENT) {
            // Because mUiccCard may be updated in both IccCardStatus and IccSlotStatus, we need to
            // create a new UiccCard instance in two scenarios:
            //   1. mCardState is changing from ABSENT to non ABSENT.
            //   2. The latest mCardState is not ABSENT, but there is no UiccCard instance.
            } else if ((oldState == null || 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) {
                    if (DBG) log("update: notify card added");
@@ -136,7 +142,7 @@ public class UiccSlot extends Handler {
     * Update slot based on IccSlotStatus.
     */
    public void update(CommandsInterface ci, IccSlotStatus iss) {
        log("slotStatus update");
        if (DBG) log("slotStatus update: " + iss.toString());
        synchronized (mLock) {
            mCi = ci;
            if (iss.slotState == IccSlotStatus.SlotState.SLOTSTATE_INACTIVE) {