use of com.android.internal.telephony.dataconnection.DataConnection in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTracker method updateNrFrequencyRangeFromPhysicalChannelConfigs.
private boolean updateNrFrequencyRangeFromPhysicalChannelConfigs(List<PhysicalChannelConfig> physicalChannelConfigs, ServiceState ss) {
int newFrequencyRange = ServiceState.FREQUENCY_RANGE_UNKNOWN;
if (physicalChannelConfigs != null) {
DcTracker dcTracker = mPhone.getDcTracker(AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
for (PhysicalChannelConfig config : physicalChannelConfigs) {
if (isNrPhysicalChannelConfig(config)) {
// Update the frequency range of the NR parameters if there is an internet data
// connection associate to this NR physical channel channel config.
int[] contextIds = config.getContextIds();
for (int cid : contextIds) {
DataConnection dc = dcTracker.getDataConnectionByContextId(cid);
if (dc != null && dc.getNetworkCapabilities().hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)) {
newFrequencyRange = ServiceState.getBetterNRFrequencyRange(newFrequencyRange, config.getFrequencyRange());
break;
}
}
}
}
}
boolean hasChanged = newFrequencyRange != ss.getNrFrequencyRange();
ss.setNrFrequencyRange(newFrequencyRange);
return hasChanged;
}
Aggregations