use of android.telephony.PhoneCapability in project android_packages_apps_Settings by omnirom.
the class NetworkScanHelperTest method createNetworkScanForPreferredAccessNetworks_deviceNoNrSa_noNgran.
@Test
public void createNetworkScanForPreferredAccessNetworks_deviceNoNrSa_noNgran() {
int[] deviceNrCapabilities = new int[] { PhoneCapability.DEVICE_NR_CAPABILITY_NSA };
PhoneCapability phoneCapability = createPhoneCapability(deviceNrCapabilities);
doReturn(TelephonyManager.NETWORK_CLASS_BITMASK_2G | TelephonyManager.NETWORK_CLASS_BITMASK_3G | TelephonyManager.NETWORK_CLASS_BITMASK_4G | TelephonyManager.NETWORK_CLASS_BITMASK_5G).when(mTelephonyManager).getPreferredNetworkTypeBitmask();
doReturn(phoneCapability).when(mTelephonyManager).getPhoneCapability();
List<RadioAccessSpecifier> radioAccessSpecifiers = new ArrayList<>();
radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.GERAN, null, null));
radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.UTRAN, null, null));
radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.EUTRAN, null, null));
NetworkScanRequest expectedNetworkScanRequest = createNetworkScanRequest(radioAccessSpecifiers);
assertEquals(expectedNetworkScanRequest, mNetworkScanHelper.createNetworkScanForPreferredAccessNetworks());
}
use of android.telephony.PhoneCapability 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);
}
use of android.telephony.PhoneCapability in project android_frameworks_opt_telephony by LineageOS.
the class PhoneSwitcherTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp(getClass().getSimpleName());
PhoneCapability phoneCapability = new PhoneCapability(1, 1, 0, null, false);
doReturn(phoneCapability).when(mPhoneConfigurationManager).getCurrentPhoneCapability();
doReturn(Call.State.ACTIVE).when(mActiveCall).getState();
doReturn(Call.State.IDLE).when(mInactiveCall).getState();
doReturn(Call.State.HOLDING).when(mHoldingCall).getState();
replaceInstance(Phone.class, "mCi", mPhone, mCommandsInterface0);
replaceInstance(Phone.class, "mCi", mPhone2, mCommandsInterface1);
}
use of android.telephony.PhoneCapability in project android_frameworks_opt_telephony by LineageOS.
the class PhoneCapabilityTest method basicTests.
@Test
@SmallTest
public void basicTests() 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);
assertEquals(maxActiveVoiceCalls, capability.maxActiveVoiceCalls);
assertEquals(maxActiveData, capability.maxActiveData);
assertEquals(max5G, capability.max5G);
assertEquals(1, capability.logicalModemList.size());
assertEquals(modemInfo, capability.logicalModemList.get(0));
PhoneCapability toCompare = new PhoneCapability(maxActiveVoiceCalls + 1, maxActiveData - 1, max5G, logicalModemList, false);
assertEquals(capability, new PhoneCapability(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList, false));
assertNotEquals(capability, toCompare);
}
Aggregations