use of android.telephony.ModemInfo in project android_frameworks_opt_telephony by LineageOS.
the class RadioConfigResponse method convertHalPhoneCapability.
private PhoneCapability convertHalPhoneCapability(android.hardware.radio.config.V1_1.PhoneCapability phoneCapability) {
// TODO b/121394331: clean up V1_1.PhoneCapability fields.
int maxActiveVoiceCalls = 0;
int maxActiveData = phoneCapability.maxActiveData;
int max5G = 0;
boolean validationBeforeSwitchSupported = phoneCapability.isInternetLingeringSupported;
List<ModemInfo> logicalModemList = new ArrayList();
for (android.hardware.radio.config.V1_1.ModemInfo modemInfo : phoneCapability.logicalModemList) {
logicalModemList.add(new ModemInfo(modemInfo.modemId));
}
return new PhoneCapability(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList, validationBeforeSwitchSupported);
}
use of android.telephony.ModemInfo in project android_frameworks_opt_telephony by LineageOS.
the class PhoneCapabilityTest method parcelReadWrite.
@Test
@SmallTest
public void parcelReadWrite() throws Exception {
int maxActiveVoiceCalls = 1;
int maxActiveData = 2;
int max5G = 3;
ModemInfo modemInfo = new ModemInfo(1, 2, true, false);
List<ModemInfo> logicalModemList = new ArrayList<>();
logicalModemList.add(modemInfo);
PhoneCapability capability = new PhoneCapability(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList, false);
Parcel parcel = Parcel.obtain();
capability.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
PhoneCapability toCompare = PhoneCapability.CREATOR.createFromParcel(parcel);
assertEquals(maxActiveVoiceCalls, toCompare.maxActiveVoiceCalls);
assertEquals(maxActiveData, toCompare.maxActiveData);
assertEquals(max5G, toCompare.max5G);
assertEquals(1, toCompare.logicalModemList.size());
assertEquals(modemInfo, toCompare.logicalModemList.get(0));
assertEquals(capability, toCompare);
}
use of android.telephony.ModemInfo in project android_frameworks_opt_telephony by LineageOS.
the class ModemInfoTest method parcelReadWrite.
@Test
@SmallTest
public void parcelReadWrite() throws Exception {
int modemId = 1;
int rat = 2;
boolean isVoiceSupported = true;
boolean isDataSupported = false;
ModemInfo modemInfo = new ModemInfo(modemId, rat, isVoiceSupported, isDataSupported);
Parcel parcel = Parcel.obtain();
modemInfo.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
ModemInfo toCompare = ModemInfo.CREATOR.createFromParcel(parcel);
assertEquals(modemId, toCompare.modemId);
assertEquals(rat, toCompare.rat);
assertEquals(isVoiceSupported, toCompare.isVoiceSupported);
assertEquals(isDataSupported, toCompare.isDataSupported);
assertEquals(modemInfo, toCompare);
}
use of android.telephony.ModemInfo in project android_frameworks_opt_telephony by LineageOS.
the class ModemInfoTest method basicTests.
@Test
@SmallTest
public void basicTests() throws Exception {
int modemId = 1;
int rat = 2;
boolean isVoiceSupported = true;
boolean isDataSupported = false;
ModemInfo modemInfo = new ModemInfo(modemId, rat, isVoiceSupported, isDataSupported);
assertEquals(modemId, modemInfo.modemId);
assertEquals(rat, modemInfo.rat);
assertEquals(isVoiceSupported, modemInfo.isVoiceSupported);
assertEquals(isDataSupported, modemInfo.isDataSupported);
assertNotEquals(modemInfo, new ModemInfo(modemId + 1, rat, isVoiceSupported, isDataSupported));
assertNotEquals(modemInfo, new ModemInfo(modemId, rat + 1, isVoiceSupported, isDataSupported));
assertNotEquals(modemInfo, new ModemInfo(modemId, rat, !isVoiceSupported, isDataSupported));
assertNotEquals(modemInfo, new ModemInfo(modemId, rat, isVoiceSupported, !isDataSupported));
}
use of android.telephony.ModemInfo in project android_packages_apps_Settings by omnirom.
the class NetworkScanHelperTest method createPhoneCapability.
private PhoneCapability createPhoneCapability(int[] deviceNrCapabilities) {
int maxActiveVoiceCalls = 1;
int maxActiveData = 2;
ModemInfo modemInfo = new ModemInfo(1, 2, true, false);
List<ModemInfo> logicalModemList = new ArrayList<>();
logicalModemList.add(modemInfo);
return new PhoneCapability(maxActiveVoiceCalls, maxActiveData, logicalModemList, false, deviceNrCapabilities);
}