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

Commit fbe79bbf authored by Sarah Chin's avatar Sarah Chin Committed by Automerger Merge Worker
Browse files

Merge "SST set state out of service when radio is off or unavailable" into tm-dev am: 8f51ebdc

parents 62118a66 8f51ebdc
Loading
Loading
Loading
Loading
+14 −8
Original line number Original line Diff line number Diff line
@@ -1948,15 +1948,22 @@ public class ServiceStateTracker extends Handler {
                err = ((CommandException)(ar.exception)).getCommandError();
                err = ((CommandException)(ar.exception)).getCommandError();
            }
            }


            if (mCi.getRadioState() != TelephonyManager.RADIO_POWER_ON) {
                log("handlePollStateResult: Invalid response due to radio off or unavailable. "
                        + "Set ServiceState to out of service.");
                pollStateInternal(false);
                return;
            }

            if (err == CommandException.Error.RADIO_NOT_AVAILABLE) {
            if (err == CommandException.Error.RADIO_NOT_AVAILABLE) {
                // Radio has crashed or turned off
                loge("handlePollStateResult: RIL returned RADIO_NOT_AVAILABLE when radio is on.");
                cancelPollState();
                cancelPollState();
                return;
                return;
            }
            }


            if (err != CommandException.Error.OP_NOT_ALLOWED_BEFORE_REG_NW) {
            if (err != CommandException.Error.OP_NOT_ALLOWED_BEFORE_REG_NW) {
                loge("RIL implementation has returned an error where it must succeed" +
                loge("handlePollStateResult: RIL returned an error where it must succeed: "
                        ar.exception);
                        + ar.exception);
            }
            }
        } else try {
        } else try {
            handlePollStateResultMessage(what, ar);
            handlePollStateResultMessage(what, ar);
@@ -3328,10 +3335,9 @@ public class ServiceStateTracker extends Handler {


    private void pollStateInternal(boolean modemTriggered) {
    private void pollStateInternal(boolean modemTriggered) {
        mPollingContext = new int[1];
        mPollingContext = new int[1];
        mPollingContext[0] = 0;
        NetworkRegistrationInfo nri;
        NetworkRegistrationInfo nri;


        log("pollState: modemTriggered=" + modemTriggered);
        log("pollState: modemTriggered=" + modemTriggered + ", radioState=" + mCi.getRadioState());


        switch (mCi.getRadioState()) {
        switch (mCi.getRadioState()) {
            case TelephonyManager.RADIO_POWER_UNAVAILABLE:
            case TelephonyManager.RADIO_POWER_UNAVAILABLE:
@@ -3365,8 +3371,8 @@ public class ServiceStateTracker extends Handler {
                mPhone.getSignalStrengthController().setSignalStrengthDefaultValues();
                mPhone.getSignalStrengthController().setSignalStrengthDefaultValues();
                mLastNitzData = null;
                mLastNitzData = null;
                mNitzState.handleNetworkUnavailable();
                mNitzState.handleNetworkUnavailable();
                // don't poll when device is shutting down or the poll was not modemTrigged
                // Don't poll when device is shutting down or the poll was not modemTriggered
                // (they sent us new radio data) and current network is not IWLAN
                // (they sent us new radio data) and the current network is not IWLAN
                if (mDeviceShuttingDown ||
                if (mDeviceShuttingDown ||
                        (!modemTriggered && ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
                        (!modemTriggered && ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
                        != mSS.getRilDataRadioTechnology())) {
                        != mSS.getRilDataRadioTechnology())) {