aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyosun Kim <hyosunkim@google.com>2023-12-12 13:51:02 +0000
committerHyosun Kim <hyosunkim@google.com>2023-12-13 13:26:59 +0000
commitea8607eb11b65fec2e7938f4631f54e7e6365daf (patch)
treea87577495c09934fe4ee9af7f95f99fc3fd27ff2
parent9feb3c43278a879538ebc45d8553b4384555b2e5 (diff)
downloadtelephony-ea8607eb11b65fec2e7938f4631f54e7e6365daf.tar.gz
Change the default infrastructure value to 'cellular|satellite'.
Bug: 315080816 Test: atest ApnSettingTest Test: atest DataProfileManagerTest Test: manual test After NTN is connected, SMS/MMS is working and Internet/Voice Call is blocked. Change-Id: I3af5dfc72865624de9db14409b2f33a221b1f026
-rw-r--r--tests/telephonytests/src/com/android/internal/telephony/data/ApnSettingTest.java33
-rw-r--r--tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java7
2 files changed, 40 insertions, 0 deletions
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/ApnSettingTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/ApnSettingTest.java
index 98d3ce5b61..378df4b944 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/ApnSettingTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/ApnSettingTest.java
@@ -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;
@@ -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());
+ }
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
index ff14f9a262..e556cb877e 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
@@ -1611,6 +1611,7 @@ public class DataProfileManagerTest extends TelephonyTest {
| TelephonyManager.NETWORK_TYPE_BITMASK_NR))
.setMvnoMatchData("")
.setApnSetId(DEFAULT_APN_SET_ID)
+ .setInfrastructureBitmask(1)
.build())
.build();
@@ -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();
@@ -1674,6 +1676,7 @@ public class DataProfileManagerTest extends TelephonyTest {
| TelephonyManager.NETWORK_TYPE_BITMASK_NR))
.setMvnoMatchData("")
.setApnSetId(APN_SET_ID_1)
+ .setInfrastructureBitmask(1)
.build())
.build();
@@ -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();
@@ -1737,6 +1741,7 @@ public class DataProfileManagerTest extends TelephonyTest {
| TelephonyManager.NETWORK_TYPE_BITMASK_NR))
.setMvnoMatchData("")
.setApnSetId(APN_SET_ID_1)
+ .setInfrastructureBitmask(1)
.build())
.build();
@@ -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();
@@ -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();