Loading src/java/com/android/internal/telephony/NetworkTypeController.java +7 −3 Original line number Diff line number Diff line Loading @@ -1261,11 +1261,15 @@ 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 && IntStream.of(mPhone.getServiceState().getCellBandwidths()).sum() < mNrAdvancedThresholdBandwidth) { if (mNrAdvancedThresholdBandwidth > 0 && bandwidths < mNrAdvancedThresholdBandwidth) { return false; } Loading tests/telephonytests/src/com/android/internal/telephony/NetworkTypeControllerTest.java +6 −1 Original line number Diff line number Diff line Loading @@ -1323,7 +1323,12 @@ 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(); doReturn(new int[] {20001}).when(mServiceState).getCellBandwidths(); List<PhysicalChannelConfig> lastPhysicalChannelConfigList = new ArrayList<>(); lastPhysicalChannelConfigList.add(new PhysicalChannelConfig.Builder() .setNetworkType(TelephonyManager.NETWORK_TYPE_NR) .setCellBandwidthDownlinkKhz(20001) .build()); doReturn(lastPhysicalChannelConfigList).when(mSST).getPhysicalChannelConfigList(); mBundle.putInt(CarrierConfigManager.KEY_NR_ADVANCED_THRESHOLD_BANDWIDTH_KHZ_INT, 20000); broadcastCarrierConfigs(); Loading Loading
src/java/com/android/internal/telephony/NetworkTypeController.java +7 −3 Original line number Diff line number Diff line Loading @@ -1261,11 +1261,15 @@ 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 && IntStream.of(mPhone.getServiceState().getCellBandwidths()).sum() < mNrAdvancedThresholdBandwidth) { if (mNrAdvancedThresholdBandwidth > 0 && bandwidths < mNrAdvancedThresholdBandwidth) { return false; } Loading
tests/telephonytests/src/com/android/internal/telephony/NetworkTypeControllerTest.java +6 −1 Original line number Diff line number Diff line Loading @@ -1323,7 +1323,12 @@ 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(); doReturn(new int[] {20001}).when(mServiceState).getCellBandwidths(); List<PhysicalChannelConfig> lastPhysicalChannelConfigList = new ArrayList<>(); lastPhysicalChannelConfigList.add(new PhysicalChannelConfig.Builder() .setNetworkType(TelephonyManager.NETWORK_TYPE_NR) .setCellBandwidthDownlinkKhz(20001) .build()); doReturn(lastPhysicalChannelConfigList).when(mSST).getPhysicalChannelConfigList(); mBundle.putInt(CarrierConfigManager.KEY_NR_ADVANCED_THRESHOLD_BANDWIDTH_KHZ_INT, 20000); broadcastCarrierConfigs(); Loading