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

Commit bdc372fa authored by Amit Mahajan's avatar Amit Mahajan Committed by android-build-merger
Browse files

Merge "Force notify radio state change to registrants if IRadio service crashes"

am: 795595a6

Change-Id: I498b54cf3093c1af6120e99eb19595d974258056
parents b285e7cb 795595a6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -792,15 +792,17 @@ public abstract class BaseCommands implements CommandsInterface {
     * RadioState has 3 values : RADIO_OFF, RADIO_UNAVAILABLE, RADIO_ON.
     *
     * @param newState new RadioState decoded from RIL_UNSOL_RADIO_STATE_CHANGED
     * @param forceNotifyRegistrants boolean indicating if registrants should be notified even if
     * there is no change in state
     */
    protected void setRadioState(RadioState newState) {
    protected void setRadioState(RadioState newState, boolean forceNotifyRegistrants) {
        RadioState oldState;

        synchronized (mStateMonitor) {
            oldState = mState;
            mState = newState;

            if (oldState == mState) {
            if (oldState == mState && !forceNotifyRegistrants) {
                // no state transition
                return;
            }
+2 −2
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        // increment the cookie so that death notification can be ignored
        mRadioProxyCookie.incrementAndGet();

        setRadioState(RadioState.RADIO_UNAVAILABLE);
        setRadioState(RadioState.RADIO_UNAVAILABLE, true /* forceNotifyRegistrants */);

        RILRequest.resetSerial();
        // Clear request list on close
@@ -4188,7 +4188,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                }
                break;
            case RIL_REQUEST_SHUTDOWN:
                setRadioState(RadioState.RADIO_UNAVAILABLE);
                setRadioState(RadioState.RADIO_UNAVAILABLE, false /* forceNotifyRegistrants */);
                break;
        }

+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class RadioIndication extends IRadioIndication.Stub {
                    newState);
        }

        mRil.setRadioState(newState);
        mRil.setRadioState(newState, false /* forceNotifyRegistrants */);
    }

    public void callStateChanged(int indicationType) {
+5 −5
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ public class SimulatedCommands extends BaseCommands

        simulatedCallState = new SimulatedGsmCallState(looper);

        setRadioState(RadioState.RADIO_ON);
        setRadioState(RadioState.RADIO_ON, false /* forceNotifyRegistrants */);
        mSimLockedState = INITIAL_LOCK_STATE;
        mSimLockEnabled = (mSimLockedState != SimLockState.NONE);
        mPinCode = DEFAULT_SIM_PIN_CODE;
@@ -1241,9 +1241,9 @@ public class SimulatedCommands extends BaseCommands
        }

        if(on) {
            setRadioState(RadioState.RADIO_ON);
            setRadioState(RadioState.RADIO_ON, false /* forceNotifyRegistrants */);
        } else {
            setRadioState(RadioState.RADIO_OFF);
            setRadioState(RadioState.RADIO_OFF, false /* forceNotifyRegistrants */);
        }
        resultSuccess(result, null);
    }
@@ -1599,7 +1599,7 @@ public class SimulatedCommands extends BaseCommands
    @Override
    public void
    shutdown() {
        setRadioState(RadioState.RADIO_UNAVAILABLE);
        setRadioState(RadioState.RADIO_UNAVAILABLE, false /* forceNotifyRegistrants */);
        Looper looper = mHandlerThread.getLooper();
        if (looper != null) {
            looper.quit();
@@ -2024,7 +2024,7 @@ public class SimulatedCommands extends BaseCommands

    @Override
    public void requestShutdown(Message result) {
        setRadioState(RadioState.RADIO_UNAVAILABLE);
        setRadioState(RadioState.RADIO_UNAVAILABLE, false /* forceNotifyRegistrants */);
    }

    @Override