Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc3b877f authored by Hyosun Kim's avatar Hyosun Kim Committed by Android (Google) Code Review
Browse files

Merge "Change the default infrastructure value to 'cellular|satellite'." into main

parents f13db53b ea8607eb
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -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());
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -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();