Loading tests/telephonytests/src/com/android/internal/telephony/data/ApnSettingTest.java +33 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.internal.telephony.data; import static android.telephony.data.ApnSetting.INFRASTRUCTURE_CELLULAR; import static android.telephony.data.ApnSetting.INFRASTRUCTURE_SATELLITE; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; Loading Loading @@ -381,4 +384,34 @@ public class ApnSettingTest extends TelephonyTest { .build(); assertEquals("proxy.mobile.att.net", apn3.getMmsProxyAddressAsString()); } @Test public void testBuild_InfrastructureBitmask() { int infrastructureBitmask = INFRASTRUCTURE_CELLULAR | INFRASTRUCTURE_SATELLITE; ApnSetting apn1 = new ApnSetting.Builder() .setId(1234) .setOperatorNumeric("310260") .setEntryName("mms") .setApnName("mms") .setApnTypeBitmask(ApnSetting.TYPE_MMS | ApnSetting.TYPE_DEFAULT) .setProtocol(ApnSetting.PROTOCOL_IPV4V6) .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_LTE)) .build(); // InfrastructureBitmask default value set to '3(cellular|satellite)' assertEquals(infrastructureBitmask, apn1.getInfrastructureBitmask()); infrastructureBitmask = INFRASTRUCTURE_CELLULAR; ApnSetting apn2 = new ApnSetting.Builder() .setId(1235) .setOperatorNumeric("310260") .setEntryName("mms") .setApnName("mms") .setApnTypeBitmask(ApnSetting.TYPE_MMS | ApnSetting.TYPE_DEFAULT) .setProtocol(ApnSetting.PROTOCOL_IPV4V6) .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_LTE)) .setInfrastructureBitmask(infrastructureBitmask) .build(); // InfrastructureBitmask value set to '1(cellular)' assertEquals(infrastructureBitmask, apn2.getInfrastructureBitmask()); } } tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -1611,6 +1611,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(DEFAULT_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1646,6 +1647,7 @@ public class DataProfileManagerTest extends TelephonyTest { .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(DEFAULT_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1674,6 +1676,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(APN_SET_ID_1) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1702,6 +1705,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(MATCH_ALL_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1737,6 +1741,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(APN_SET_ID_1) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1765,6 +1770,7 @@ public class DataProfileManagerTest extends TelephonyTest { .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(DEFAULT_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1793,6 +1799,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(MATCH_ALL_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading
tests/telephonytests/src/com/android/internal/telephony/data/ApnSettingTest.java +33 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.internal.telephony.data; import static android.telephony.data.ApnSetting.INFRASTRUCTURE_CELLULAR; import static android.telephony.data.ApnSetting.INFRASTRUCTURE_SATELLITE; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; Loading Loading @@ -381,4 +384,34 @@ public class ApnSettingTest extends TelephonyTest { .build(); assertEquals("proxy.mobile.att.net", apn3.getMmsProxyAddressAsString()); } @Test public void testBuild_InfrastructureBitmask() { int infrastructureBitmask = INFRASTRUCTURE_CELLULAR | INFRASTRUCTURE_SATELLITE; ApnSetting apn1 = new ApnSetting.Builder() .setId(1234) .setOperatorNumeric("310260") .setEntryName("mms") .setApnName("mms") .setApnTypeBitmask(ApnSetting.TYPE_MMS | ApnSetting.TYPE_DEFAULT) .setProtocol(ApnSetting.PROTOCOL_IPV4V6) .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_LTE)) .build(); // InfrastructureBitmask default value set to '3(cellular|satellite)' assertEquals(infrastructureBitmask, apn1.getInfrastructureBitmask()); infrastructureBitmask = INFRASTRUCTURE_CELLULAR; ApnSetting apn2 = new ApnSetting.Builder() .setId(1235) .setOperatorNumeric("310260") .setEntryName("mms") .setApnName("mms") .setApnTypeBitmask(ApnSetting.TYPE_MMS | ApnSetting.TYPE_DEFAULT) .setProtocol(ApnSetting.PROTOCOL_IPV4V6) .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_LTE)) .setInfrastructureBitmask(infrastructureBitmask) .build(); // InfrastructureBitmask value set to '1(cellular)' assertEquals(infrastructureBitmask, apn2.getInfrastructureBitmask()); } }
tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -1611,6 +1611,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(DEFAULT_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1646,6 +1647,7 @@ public class DataProfileManagerTest extends TelephonyTest { .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(DEFAULT_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1674,6 +1676,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(APN_SET_ID_1) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1702,6 +1705,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(MATCH_ALL_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1737,6 +1741,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(APN_SET_ID_1) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1765,6 +1770,7 @@ public class DataProfileManagerTest extends TelephonyTest { .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(DEFAULT_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading Loading @@ -1793,6 +1799,7 @@ public class DataProfileManagerTest extends TelephonyTest { | TelephonyManager.NETWORK_TYPE_BITMASK_NR)) .setMvnoMatchData("") .setApnSetId(MATCH_ALL_APN_SET_ID) .setInfrastructureBitmask(1) .build()) .build(); Loading