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

Commit 3a0d8a6f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "MSIM: Fix to send SET_UICC after RILD crash"

parents f5c14f6f 00947401
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ public class ModemStackController extends Handler {
    private  static final int EVENT_SUB_DEACTIVATED = 8;
    private static final int EVENT_RADIO_AVAILABLE = 9;
    private static final int EVENT_MODEM_CAPABILITY_CHANGED = 10;
    private static final int EVENT_RADIO_NOT_AVAILABLE = 11;

    //*****States
    private static final int STATE_UNKNOWN = 1;
@@ -262,6 +263,7 @@ public class ModemStackController extends Handler {
        for (int i = 0; i < mCi.length; i++) {
            mCi[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, new Integer(i));
            mCi[i].registerForModemCapEvent(this, EVENT_MODEM_CAPABILITY_CHANGED, null);
            mCi[i].registerForNotAvailable(this, EVENT_RADIO_NOT_AVAILABLE, new Integer(i));
        }

        for (int i = 0; i < mNumPhones; i++) {
@@ -353,6 +355,13 @@ public class ModemStackController extends Handler {
                onSetPrefNwModeDone(ar, phoneId);
                break;

            case EVENT_RADIO_NOT_AVAILABLE:
                ar = (AsyncResult)msg.obj;
                phoneId = (Integer)ar.userObj;
                logd("EVENT_RADIO_NOT_AVAILABLE, phoneId = " + phoneId);
                processRadioNotAvailable(ar, phoneId);
                break;

            default:
                break;
        }
@@ -373,6 +382,16 @@ public class ModemStackController extends Handler {
        }
    }

    // RADIO state moved to UNAVAILABLE, reset cached modem cap info
    private void processRadioNotAvailable(AsyncResult ar, int phoneId) {
        logd("processRadioNotAvailable on phoneId = " + phoneId);
        if (phoneId >= 0 && phoneId < mNumPhones) {
            mModemCapInfo[mCurrentStackId[phoneId]] = null;
        } else {
            loge("Invalid Index!!!");
        }
    }

    private void onGetModemCapabilityDone(AsyncResult ar, byte[] result, int phoneId) {

        if (result == null && ar.exception instanceof CommandException) {
@@ -391,7 +410,7 @@ public class ModemStackController extends Handler {
            parseGetModemCapabilityResponse(result, phoneId);

            //Wait till we get Modem Capabilities on all subs
            if (areAllSubsinSameState(STATE_GOT_MODEM_CAPS)) {
            if (areAllModemCapInfoReceived()) {
                notifyModemRatCapabilitiesAvailable();
            }
        } else {
@@ -565,6 +584,13 @@ public class ModemStackController extends Handler {
        return true;
    }

    private boolean areAllModemCapInfoReceived() {
        for (int i = 0; i < mNumPhones; i++) {
            if (mModemCapInfo[mCurrentStackId[i]] == null) return false;
        }
        return true;
    }

    private void resetSubStates() {
        for (int i = 0; i < mNumPhones; i++) {
            mSubState[i] = STATE_UNKNOWN;
@@ -748,6 +774,7 @@ public class ModemStackController extends Handler {
                mUpdateStackMsg = null;
            }
            notifyStackReady(false);
            return;
        }
        for (SubscriptionInfo subInfo : subInfoList) {
            int subStatus = subCtrlr.getSubState(subInfo.getSubscriptionId());