FileDocCategorySizeDatePackage
UsimServiceTableTest.javaAPI DocAndroid 5.1 API4103Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony.gsm

UsimServiceTableTest

public class UsimServiceTableTest extends android.test.AndroidTestCase
Test UsimServiceTable class.

Fields Summary
Constructors Summary
Methods Summary
public voidtestUsimServiceTable()

        byte[] noServices = {0x00};
        byte[] service1 = {0x01, 0x00};
        byte[] service8 = {(byte) 0x80, 0x00, 0x00};
        byte[] service8And9 = {(byte) 0x80, 0x01};
        byte[] service28 = {0x00, 0x00, 0x00, 0x08};
        byte[] service89To96 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, (byte) 0xff};

        UsimServiceTable testTable1 = new UsimServiceTable(noServices);
        assertFalse(testTable1.isAvailable(UsimServiceTable.UsimService.PHONEBOOK));
        assertFalse(testTable1.isAvailable(UsimServiceTable.UsimService.FDN));
        assertFalse(testTable1.isAvailable(UsimServiceTable.UsimService.NAS_CONFIG_BY_USIM));

        UsimServiceTable testTable2 = new UsimServiceTable(service1);
        assertTrue(testTable2.isAvailable(UsimServiceTable.UsimService.PHONEBOOK));
        assertFalse(testTable2.isAvailable(UsimServiceTable.UsimService.FDN));
        assertFalse(testTable2.isAvailable(UsimServiceTable.UsimService.NAS_CONFIG_BY_USIM));

        UsimServiceTable testTable3 = new UsimServiceTable(service8);
        assertFalse(testTable3.isAvailable(UsimServiceTable.UsimService.PHONEBOOK));
        assertFalse(testTable3.isAvailable(UsimServiceTable.UsimService.BDN_EXTENSION));
        assertTrue(testTable3.isAvailable(UsimServiceTable.UsimService.OUTGOING_CALL_INFO));
        assertFalse(testTable3.isAvailable(UsimServiceTable.UsimService.INCOMING_CALL_INFO));
        assertFalse(testTable3.isAvailable(UsimServiceTable.UsimService.NAS_CONFIG_BY_USIM));

        UsimServiceTable testTable4 = new UsimServiceTable(service8And9);
        assertFalse(testTable4.isAvailable(UsimServiceTable.UsimService.PHONEBOOK));
        assertFalse(testTable4.isAvailable(UsimServiceTable.UsimService.BDN_EXTENSION));
        assertTrue(testTable4.isAvailable(UsimServiceTable.UsimService.OUTGOING_CALL_INFO));
        assertTrue(testTable4.isAvailable(UsimServiceTable.UsimService.INCOMING_CALL_INFO));
        assertFalse(testTable4.isAvailable(UsimServiceTable.UsimService.SM_STORAGE));
        assertFalse(testTable4.isAvailable(UsimServiceTable.UsimService.NAS_CONFIG_BY_USIM));

        UsimServiceTable testTable5 = new UsimServiceTable(service28);
        assertFalse(testTable5.isAvailable(UsimServiceTable.UsimService.PHONEBOOK));
        assertTrue(testTable5.isAvailable(UsimServiceTable.UsimService.DATA_DL_VIA_SMS_PP));
        assertFalse(testTable5.isAvailable(UsimServiceTable.UsimService.NAS_CONFIG_BY_USIM));

        UsimServiceTable testTable6 = new UsimServiceTable(service89To96);
        assertFalse(testTable6.isAvailable(UsimServiceTable.UsimService.PHONEBOOK));
        assertFalse(testTable6.isAvailable(UsimServiceTable.UsimService.HPLMN_DIRECT_ACCESS));
        assertTrue(testTable6.isAvailable(UsimServiceTable.UsimService.ECALL_DATA));
        assertTrue(testTable6.isAvailable(UsimServiceTable.UsimService.SM_OVER_IP));
        assertTrue(testTable6.isAvailable(UsimServiceTable.UsimService.UICC_ACCESS_TO_IMS));
        assertTrue(testTable6.isAvailable(UsimServiceTable.UsimService.NAS_CONFIG_BY_USIM));