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

Commit 21d0fe9d authored by Sarah Chin's avatar Sarah Chin
Browse files

NetworkTypeController update on PCC changed for LTE/LTE+ switch

In legacy mode, PCC changed could update the cell bandwidths, changing
between LTE/LTE+. Update the overrideNetworkType on PCC changed to make
sure the state is accurate

Test: atest ServiceStateTrackerTest, NetworkTypeControllerTest
Fix: 185550402
Change-Id: If2a1e6215c0126988f214e2fa42d8102ac582621
parent 6895ab85
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -612,15 +612,14 @@ public class NetworkTypeController extends StateMachine {
                    // ignored
                    break;
                case EVENT_PHYSICAL_CHANNEL_CONFIG_CHANGED:
                    if (!mIsPhysicalChannelConfig16Supported) {
                        // ignore
                        break;
                    }
                    if (mIsPhysicalChannelConfig16Supported) {
                        mPhysicalLinkState = getPhysicalLinkStateFromPhysicalChannelConfig();
                        if (mIsTimerResetEnabledForLegacyStateRRCIdle && !isPhysicalLinkActive()) {
                            resetAllTimers();
                        updateOverrideNetworkType();
                        }
                    }
                    // Update in case of LTE/LTE+ switch
                    updateOverrideNetworkType();
                    break;
                case EVENT_PHYSICAL_LINK_STATE_CHANGED:
                    AsyncResult ar = (AsyncResult) msg.obj;
+1 −1
Original line number Diff line number Diff line
@@ -1717,7 +1717,6 @@ public class ServiceStateTracker extends Handler {
                        log("EVENT_PHYSICAL_CHANNEL_CONFIG: size=" + list.size() + " list="
                                + list);
                    }
                    mPhone.notifyPhysicalChannelConfig(list);
                    mLastPhysicalChannelConfigList = list;
                    boolean hasChanged = false;
                    if (updateNrStateFromPhysicalChannelConfigs(list, mSS)) {
@@ -1731,6 +1730,7 @@ public class ServiceStateTracker extends Handler {
                    hasChanged |= RatRatcheter
                            .updateBandwidths(getBandwidthsFromConfigs(list), mSS);

                    mPhone.notifyPhysicalChannelConfig(list);
                    // Notify NR frequency, NR connection status or bandwidths changed.
                    if (hasChanged) {
                        mPhone.notifyServiceStateChanged(mSS);
+17 −1
Original line number Diff line number Diff line
@@ -478,7 +478,6 @@ public class NetworkTypeControllerTest extends TelephonyTest {
        mBundle.putInt(CarrierConfigManager.KEY_NR_ADVANCED_CAPABLE_PCO_ID_INT, 0xFF03);
        broadcastCarrierConfigs();


        mNetworkTypeController.sendMessage(EVENT_PCO_DATA_CHANGED,
                new AsyncResult(null, new PcoData(cid, "", 0xff03, contents), null));
        mNetworkTypeController.sendMessage(NetworkTypeController.EVENT_UPDATE);
@@ -565,6 +564,23 @@ public class NetworkTypeControllerTest extends TelephonyTest {
        assertEquals("not_restricted_rrc_con", getCurrentState().getName());
    }

    @Test
    public void testPhysicalChannelChangeFromLteToLteCa() throws Exception {
        testTransitionToCurrentStateLegacy();
        doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mServiceState).getDataNetworkType();
        updateOverrideNetworkType();
        assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE,
                mNetworkTypeController.getOverrideNetworkType());

        doReturn(true).when(mServiceState).isUsingCarrierAggregation();
        doReturn(new int[] {30000}).when(mServiceState).getCellBandwidths();
        mNetworkTypeController.sendMessage(EVENT_PHYSICAL_CHANNEL_CONFIG_CHANGED);
        processAllMessages();

        assertEquals(TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA,
                mNetworkTypeController.getOverrideNetworkType());
    }

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