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

Commit 3a45d596 authored by Jack Yu's avatar Jack Yu
Browse files

Revert "Use NR configs for minimum NR advanced bandwidth threshold"

This reverts commit 29c27573.

Reason for revert: b/260301879

Change-Id: Iec58ef365d7d60a7a93d7fd95968e5c2c105f09e
parent 82ba15a8
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -524,8 +524,7 @@ public class NetworkTypeController extends StateMachine {
        int value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE;
        if ((getDataNetworkType() == TelephonyManager.NETWORK_TYPE_LTE_CA
                || mServiceState.isUsingCarrierAggregation())
                && IntStream.of(mServiceState.getCellBandwidths()).sum()
                > mLtePlusThresholdBandwidth) {
                && getBandwidth() > mLtePlusThresholdBandwidth) {
            value = TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA;
        }
        if (isLteEnhancedAvailable()) {
@@ -1287,15 +1286,9 @@ public class NetworkTypeController extends StateMachine {
            return false;
        }

        int bandwidths = mPhone.getServiceStateTracker().getPhysicalChannelConfigList()
                .stream()
                .filter(config -> config.getNetworkType() == TelephonyManager.NETWORK_TYPE_NR)
                .map(PhysicalChannelConfig::getCellBandwidthDownlinkKhz)
                .mapToInt(Integer::intValue)
                .sum();
        // Check if meeting minimum bandwidth requirement. For most carriers, there is no minimum
        // bandwidth requirement and mNrAdvancedThresholdBandwidth is 0.
        if (mNrAdvancedThresholdBandwidth > 0 && bandwidths < mNrAdvancedThresholdBandwidth) {
        if (mNrAdvancedThresholdBandwidth > 0 && getBandwidth() < mNrAdvancedThresholdBandwidth) {
            return false;
        }

@@ -1336,6 +1329,10 @@ public class NetworkTypeController extends StateMachine {
                ? DataCallResponse.LINK_STATUS_DORMANT : DataCallResponse.LINK_STATUS_ACTIVE;
    }

    private int getBandwidth() {
        return IntStream.of(mServiceState.getCellBandwidths()).sum();
    }

    private String getEventName(int event) {
        try {
            return sEvents[event];
+2 −7
Original line number Diff line number Diff line
@@ -1240,16 +1240,11 @@ public class NetworkTypeControllerTest extends TelephonyTest {
        doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mServiceState).getDataNetworkType();
        doReturn(NetworkRegistrationInfo.NR_STATE_CONNECTED).when(mServiceState).getNrState();
        doReturn(ServiceState.FREQUENCY_RANGE_MMWAVE).when(mServiceState).getNrFrequencyRange();
        List<PhysicalChannelConfig> lastPhysicalChannelConfigList = new ArrayList<>();
        lastPhysicalChannelConfigList.add(new PhysicalChannelConfig.Builder()
                .setNetworkType(TelephonyManager.NETWORK_TYPE_NR)
                .setCellBandwidthDownlinkKhz(20001)
                .build());
        doReturn(lastPhysicalChannelConfigList).when(mSST).getPhysicalChannelConfigList();
        doReturn(new int[] {20001}).when(mServiceState).getCellBandwidths();
        mBundle.putInt(CarrierConfigManager.KEY_NR_ADVANCED_THRESHOLD_BANDWIDTH_KHZ_INT, 20000);
        broadcastCarrierConfigs();

        mNetworkTypeController.sendMessage(11 /* EVENT_PHYSICAL_CHANNEL_CONFIG_CHANGED */);
        mNetworkTypeController.sendMessage(3 /* EVENT_SERVICE_STATE_CHANGED */);
        processAllMessages();
        assertEquals("connected_mmwave", getCurrentState().getName());
    }