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

Commit b9636f80 authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Gerrit Code Review
Browse files

Abort Cross mapping process if SubInfo List is null

Abort cross mapping process if the SubInfo List is null
and notify Stack is ready for other processes to continue.

Change-Id: I836484b06c29b63f86d1c264d3c7bd386b6c580e
CRs-Fixed: 767026
(cherry picked from commit d683d69f)
parent 3347bb52
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -368,8 +368,7 @@ public class ModemStackController extends Handler {
            loge("onGetModemCapabilityDone: EXIT!, result null or Exception =" + ar.exception);
            //On Modem Packages which do not support GetModemCaps RIl will return exception
            //On such Modem packages notify stack is ready so that SUB Activation can continue.
            mIsStackReady = true;
            mStackReadyRegistrants.notifyRegistrants();
            notifyStackReady(false);
            return;
        }

@@ -429,9 +428,7 @@ public class ModemStackController extends Handler {
            //if any deact failed notify registrants to activate any deactivated subs
            //and stop binding process. No need to recover here.
            if (isAnyCmdFailed()) {
                mIsRecoveryInProgress = false;
                mIsStackReady = true;
                mStackReadyRegistrants.notifyRegistrants();
                notifyStackReady(false);
            } else {
                mDeactivationInProgress = false;
                triggerUnBindingOnAllSubs();
@@ -507,7 +504,7 @@ public class ModemStackController extends Handler {
                mUpdateStackMsg = null;
            }
            updateNetworkSelectionMode();
            notifyStackReady();
            notifyStackReady(true);
        }
    }

@@ -715,7 +712,7 @@ public class ModemStackController extends Handler {
            }
        } else {
            //incase of bootup if cross binding is not required send stack ready notification.
            if (isBootUp) notifyStackReady();
            if (isBootUp) notifyStackReady(false);
            return FAILURE;
        }
        return SUCCESS;
@@ -725,6 +722,10 @@ public class ModemStackController extends Handler {
        SubscriptionController subCtrlr = SubscriptionController.getInstance();
        List<SubInfoRecord> subInfoList = subCtrlr.getActiveSubInfoList();
        mActiveSubCount = 0;
        if (subInfoList == null) {
            //if getting sub info list is failed, abort cross mapping process.
            notifyStackReady(false);
        }
        for (SubInfoRecord subInfo : subInfoList) {
            int subStatus = subCtrlr.getSubState(subInfo.subId);
            if (subStatus == SubscriptionManager.ACTIVE) {
@@ -742,17 +743,18 @@ public class ModemStackController extends Handler {
        }
    }

    private void notifyStackReady() {
    private void notifyStackReady(boolean isCrossMapDone) {
        logd("notifyStackReady: Stack is READY!!!");
        mIsRecoveryInProgress = false;
        mIsStackReady = true;
        resetSubStates();

        if (isCrossMapDone) {
            for (int i = 0; i < mNumPhones; i++) {
                //update the current stackIds
                mCurrentStackId[i] = mPreferredStackId[i];
            }

        }
        //notify binding completed to all StackReady registrants.
        //including subscriptionManager which activates available subs on binding complete.
        mStackReadyRegistrants.notifyRegistrants();
@@ -809,7 +811,7 @@ public class ModemStackController extends Handler {
            if(STATE_SET_PREF_MODE == mSubState[0]) {
                //Already recovery in progress, got failure in SetPrefNwmode. We are bailing out.
                //As Set Pref is failed, Binding is completed. so update and notify same.
                notifyStackReady();
                notifyStackReady(true);
            }
            return;
        }