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

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

Merge "NetworkTypeController only transition to state if new state is...

Merge "NetworkTypeController only transition to state if new state is different" into rvc-dev am: bb0e0875 am: bd5d6cc9 am: ed2112df

Change-Id: I574a56d69f4efcc93a014ff9a6dc3c02aeab2a14
parents e7e69df9 ed2112df
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -435,6 +435,9 @@ public class NetworkTypeController extends StateMachine {
                case EVENT_PHYSICAL_CHANNEL_CONFIG_NOTIF_CHANGED:
                case EVENT_PHYSICAL_CHANNEL_CONFIG_NOTIF_CHANGED:
                    AsyncResult result = (AsyncResult) msg.obj;
                    AsyncResult result = (AsyncResult) msg.obj;
                    mIsPhysicalChannelConfigOn = (boolean) result.result;
                    mIsPhysicalChannelConfigOn = (boolean) result.result;
                    if (DBG) {
                        log("mIsPhysicalChannelConfigOn changed to: " + mIsPhysicalChannelConfigOn);
                    }
                    for (int event : ALL_EVENTS) {
                    for (int event : ALL_EVENTS) {
                        removeMessages(event);
                        removeMessages(event);
                    }
                    }
@@ -753,21 +756,27 @@ public class NetworkTypeController extends StateMachine {


    private void transitionToCurrentState() {
    private void transitionToCurrentState() {
        int dataRat = mPhone.getServiceState().getDataNetworkType();
        int dataRat = mPhone.getServiceState().getDataNetworkType();
        IState transitionState;
        if (dataRat == TelephonyManager.NETWORK_TYPE_NR || isNrConnected()) {
        if (dataRat == TelephonyManager.NETWORK_TYPE_NR || isNrConnected()) {
            transitionTo(mNrConnectedState);
            transitionState = mNrConnectedState;
            mPreviousState = isNrMmwave() ? STATE_CONNECTED_MMWAVE : STATE_CONNECTED;
            mPreviousState = isNrMmwave() ? STATE_CONNECTED_MMWAVE : STATE_CONNECTED;
        } else if (isLte(dataRat) && isNrNotRestricted()) {
        } else if (isLte(dataRat) && isNrNotRestricted()) {
            if (isDataActive()) {
            if (isDataActive()) {
                transitionTo(mLteConnectedState);
                transitionState = mLteConnectedState;
                mPreviousState = STATE_NOT_RESTRICTED_RRC_CON;
                mPreviousState = STATE_NOT_RESTRICTED_RRC_CON;
            } else {
            } else {
                transitionTo(mIdleState);
                transitionState = mIdleState;
                mPreviousState = STATE_NOT_RESTRICTED_RRC_IDLE;
                mPreviousState = STATE_NOT_RESTRICTED_RRC_IDLE;
            }
            }
        } else {
        } else {
            transitionTo(mLegacyState);
            transitionState = mLegacyState;
            mPreviousState = isNrRestricted() ? STATE_RESTRICTED : STATE_LEGACY;
            mPreviousState = isNrRestricted() ? STATE_RESTRICTED : STATE_LEGACY;
        }
        }
        if (!transitionState.equals(getCurrentState())) {
            transitionTo(transitionState);
        } else {
            updateOverrideNetworkType();
        }
    }
    }


    private void updateTimers() {
    private void updateTimers() {