use of android.telephony.PhysicalChannelConfig in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class RadioInfo method updatePhysicalChannelConfiguration.
private void updatePhysicalChannelConfiguration(List<PhysicalChannelConfig> configs) {
StringBuilder sb = new StringBuilder();
String div = "";
sb.append("{");
if (configs != null) {
for (PhysicalChannelConfig c : configs) {
sb.append(div).append(c);
div = ",";
}
}
sb.append("}");
mPhyChanConfig.setText(sb.toString());
}
use of android.telephony.PhysicalChannelConfig in project android_frameworks_opt_telephony by LineageOS.
the class RadioIndication method physicalChannelConfigsIndication.
private void physicalChannelConfigsIndication(List<? extends Object> configs) {
List<PhysicalChannelConfig> response = new ArrayList<>(configs.size());
for (Object obj : configs) {
if (obj instanceof android.hardware.radio.V1_2.PhysicalChannelConfig) {
android.hardware.radio.V1_2.PhysicalChannelConfig config = (android.hardware.radio.V1_2.PhysicalChannelConfig) obj;
response.add(new PhysicalChannelConfig.Builder().setCellConnectionStatus(convertConnectionStatusFromCellConnectionStatus(config.status)).setCellBandwidthDownlinkKhz(config.cellBandwidthDownlink).build());
} else if (obj instanceof android.hardware.radio.V1_4.PhysicalChannelConfig) {
android.hardware.radio.V1_4.PhysicalChannelConfig config = (android.hardware.radio.V1_4.PhysicalChannelConfig) obj;
PhysicalChannelConfig.Builder builder = new PhysicalChannelConfig.Builder();
setFrequencyRangeOrChannelNumber(builder, config);
response.add(builder.setCellConnectionStatus(convertConnectionStatusFromCellConnectionStatus(config.base.status)).setCellBandwidthDownlinkKhz(config.base.cellBandwidthDownlink).setRat(ServiceState.rilRadioTechnologyToNetworkType(config.rat)).setPhysicalCellId(config.physicalCellId).setContextIds(config.contextIds.stream().mapToInt(x -> x).toArray()).build());
} else {
mRil.riljLoge("Unsupported PhysicalChannelConfig " + obj);
}
}
if (RIL.RILJ_LOGD)
mRil.unsljLogRet(RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG, response);
mRil.mPhysicalChannelConfigurationRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
}
use of android.telephony.PhysicalChannelConfig in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTracker method updateNrStateFromPhysicalChannelConfigs.
private boolean updateNrStateFromPhysicalChannelConfigs(List<PhysicalChannelConfig> configs, ServiceState ss) {
NetworkRegistrationInfo regInfo = ss.getNetworkRegistrationInfo(NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (regInfo == null || configs == null)
return false;
boolean hasNrSecondaryServingCell = false;
for (PhysicalChannelConfig config : configs) {
if (isNrPhysicalChannelConfig(config) && config.getConnectionStatus() == PhysicalChannelConfig.CONNECTION_SECONDARY_SERVING) {
hasNrSecondaryServingCell = true;
break;
}
}
int oldNrState = regInfo.getNrState();
int newNrState = oldNrState;
if (hasNrSecondaryServingCell) {
newNrState = NetworkRegistrationInfo.NR_STATE_CONNECTED;
} else {
regInfo.updateNrState();
newNrState = regInfo.getNrState();
}
boolean hasChanged = newNrState != oldNrState;
regInfo.setNrState(newNrState);
ss.addNetworkRegistrationInfo(regInfo);
return hasChanged;
}
use of android.telephony.PhysicalChannelConfig 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;
}
use of android.telephony.PhysicalChannelConfig in project android_frameworks_opt_telephony by LineageOS.
the class PhysicalChannelConfigTest method testParcel.
@Test
public void testParcel() {
PhysicalChannelConfig config = new Builder().setRat(RAT).setCellConnectionStatus(CONNECTION_STATUS).setCellBandwidthDownlinkKhz(CELL_BANDWIDTH).setFrequencyRange(FREQUENCY_RANGE).setChannelNumber(CHANNEL_NUMBER).setContextIds(CONTEXT_IDS).setPhysicalCellId(PHYSICAL_CELL_ID).build();
Parcel parcel = Parcel.obtain();
config.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
PhysicalChannelConfig fromParcel = PhysicalChannelConfig.CREATOR.createFromParcel(parcel);
assertThat(fromParcel).isEqualTo(config);
}
Aggregations