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

Commit ddba96b5 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati Committed by Automerger Merge Worker
Browse files

Merge "Extract hostname if mMmsProxyAddress starts with http." into tm-qpr-dev...

Merge "Extract hostname if mMmsProxyAddress starts with http." into tm-qpr-dev am: 46bfc351 am: 14757e56

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/18721720



Change-Id: I539ba59086c5e0e7f3e26d920f051aa5b78ea074
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6c0fe8f5 14757e56
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
@@ -540,4 +540,54 @@ public class ApnSettingTest extends TelephonyTest {

        parcel.recycle();
    }

    @Test
    public void testBuild_mmsProxyAddrStartsWithHttp() {
        ApnSetting apn1 = new ApnSetting.Builder()
                .setId(1234)
                .setOperatorNumeric("310260")
                .setEntryName("mms")
                .setApnName("mms")
                .setApnTypeBitmask(ApnSetting.TYPE_MMS)
                .setProtocol(ApnSetting.PROTOCOL_IPV6)
                .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_LTE
                        | TelephonyManager.NETWORK_TYPE_BITMASK_UMTS))
                .setMtuV4(1440)
                .setCarrierEnabled(true)
                .setMmsProxyAddress("http://proxy.mobile.att.net")
                .build();
        assertEquals("proxy.mobile.att.net", apn1.getMmsProxyAddressAsString());

        ApnSetting apn2 = new ApnSetting.Builder()
                .setId(1235)
                .setOperatorNumeric("310260")
                .setEntryName("mms")
                .setApnName("mms")
                .setApnTypeBitmask(ApnSetting.TYPE_MMS)
                .setProtocol(ApnSetting.PROTOCOL_IPV6)
                .setRoamingProtocol(ApnSetting.PROTOCOL_IPV6)
                .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_EDGE
                        | TelephonyManager.NETWORK_TYPE_BITMASK_GPRS))
                .setMtuV4(1440)
                .setCarrierEnabled(true)
                .setMmsProxyAddress("https://proxy.mobile.att.net")
                .build();
        assertEquals("proxy.mobile.att.net", apn2.getMmsProxyAddressAsString());

        ApnSetting apn3 = new ApnSetting.Builder()
                .setId(1236)
                .setOperatorNumeric("310260")
                .setEntryName("mms")
                .setApnName("mms")
                .setApnTypeBitmask(ApnSetting.TYPE_MMS)
                .setProtocol(ApnSetting.PROTOCOL_IPV6)
                .setRoamingProtocol(ApnSetting.PROTOCOL_IPV6)
                .setNetworkTypeBitmask((int) (TelephonyManager.NETWORK_TYPE_BITMASK_EDGE
                        | TelephonyManager.NETWORK_TYPE_BITMASK_GPRS))
                .setMtuV4(1440)
                .setCarrierEnabled(true)
                .setMmsProxyAddress("proxy.mobile.att.net")
                .build();
        assertEquals("proxy.mobile.att.net", apn3.getMmsProxyAddressAsString());
    }
}