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

Commit 1834737b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "5G icon timer did't work after physcial channel changed." am: c5486668

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1347344

Change-Id: Ic2e3936f7ee3c110686a276f665a1be179e66054
parents f8024b98 c5486668
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -706,10 +706,16 @@ public class NetworkTypeController extends StateMachine {
                    }
                    break;
                case EVENT_NR_FREQUENCY_CHANGED:
                    if (!isNrConnected()) {
                        log("The nr state was changed. To update the state.");
                        sendMessage(EVENT_NR_STATE_CHANGED);
                    }
                    if (!isNrMmwave()) {
                        // STATE_CONNECTED_MMWAVE -> STATE_CONNECTED
                        transitionWithTimerTo(mNrConnectedState);
                    } else {
                        updateOverrideNetworkType();
                        // STATE_CONNECTED -> STATE_CONNECTED_MMWAVE
                        transitionTo(mNrConnectedState);
                    }
                    break;
                case EVENT_DATA_ACTIVITY_CHANGED:
+4 −4
Original line number Diff line number Diff line
@@ -1619,14 +1619,14 @@ public class ServiceStateTracker extends Handler {
                    mPhone.notifyPhysicalChannelConfiguration(list);
                    mLastPhysicalChannelConfigList = list;
                    boolean hasChanged = false;
                    if (updateNrFrequencyRangeFromPhysicalChannelConfigs(list, mSS)) {
                        mNrFrequencyChangedRegistrants.notifyRegistrants();
                        hasChanged = true;
                    }
                    if (updateNrStateFromPhysicalChannelConfigs(list, mSS)) {
                        mNrStateChangedRegistrants.notifyRegistrants();
                        hasChanged = true;
                    }
                    if (updateNrFrequencyRangeFromPhysicalChannelConfigs(list, mSS)) {
                        mNrFrequencyChangedRegistrants.notifyRegistrants();
                        hasChanged = true;
                    }
                    hasChanged |= RatRatcheter
                            .updateBandwidths(getBandwidthsFromConfigs(list), mSS);

+30 −1
Original line number Diff line number Diff line
@@ -253,15 +253,44 @@ public class NetworkTypeControllerTest extends TelephonyTest {
    }

    @Test
    public void testEventNrFrequencyRangeChanged() throws Exception {
    public void testEventNrFrequencyRangeChangedFromNrConnectedMmwaveToNrConnected()
            throws Exception {
        testTransitionToCurrentStateNrConnectedMmwave();
        doReturn(ServiceState.FREQUENCY_RANGE_LOW).when(mServiceState).getNrFrequencyRange();

        mNetworkTypeController.sendMessage(EVENT_NR_FREQUENCY_CHANGED);
        processAllMessages();

        assertEquals("connected", getCurrentState().getName());
    }

    @Test
    public void testEventNrFrequencyRangeChangedFromNrConnectedToNrConnectedMmwave()
            throws Exception {
        testTransitionToCurrentStateNrConnected();
        doReturn(ServiceState.FREQUENCY_RANGE_MMWAVE).when(mServiceState).getNrFrequencyRange();

        mNetworkTypeController.sendMessage(EVENT_NR_FREQUENCY_CHANGED);
        processAllMessages();

        assertEquals("connected_mmwave", getCurrentState().getName());
    }

    @Test
    public void testNrPhysicalChannelChangeFromNrConnectedMmwaveToLteConnected() throws Exception {
        testTransitionToCurrentStateNrConnectedMmwave();
        doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mServiceState).getDataNetworkType();
        doReturn(NetworkRegistrationInfo.NR_STATE_NOT_RESTRICTED).when(mServiceState).getNrState();
        doReturn(PhoneInternalInterface.DataActivityState.DATAINANDOUT)
                .when(mPhone).getDataActivityState();

        mNetworkTypeController.sendMessage(EVENT_NR_FREQUENCY_CHANGED);
        mNetworkTypeController.sendMessage(EVENT_NR_STATE_CHANGED);
        processAllMessages();

        assertEquals("not_restricted_rrc_con", getCurrentState().getName());
    }

    @Test
    public void testEventDataActivityChanged() throws Exception {
        testTransitionToCurrentStateLteConnected();