Search in sources :

Example 6 with ModemInfo

use of android.telephony.ModemInfo 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);
}
Also used : PhoneCapability(android.telephony.PhoneCapability) ArrayList(java.util.ArrayList) ModemInfo(android.telephony.ModemInfo) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

ModemInfo (android.telephony.ModemInfo)6 PhoneCapability (android.telephony.PhoneCapability)4 SmallTest (android.test.suitebuilder.annotation.SmallTest)4 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 Parcel (android.os.Parcel)2