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

Commit 4068926f authored by Jack Yu's avatar Jack Yu Committed by Android (Google) Code Review
Browse files

Merge "Added traffic descriptor for default data profiles" into tm-dev

parents 3f9de203 a675e78d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ public class DataProfileManager extends Handler {
            profiles.add(new DataProfile.Builder()
                    .setApnSetting(buildDefaultApnSetting("DEFAULT IMS", "ims",
                            ApnSetting.TYPE_IMS))
                    .setTrafficDescriptor(new TrafficDescriptor("ims", null))
                    .build());
            log("Added default IMS data profile.");
        }
@@ -250,6 +251,7 @@ public class DataProfileManager extends Handler {
            profiles.add(new DataProfile.Builder()
                    .setApnSetting(buildDefaultApnSetting("DEFAULT EIMS", "sos",
                            ApnSetting.TYPE_EMERGENCY))
                    .setTrafficDescriptor(new TrafficDescriptor("sos", null))
                    .build());
            log("Added default EIMS data profile.");
        }
+12 −0
Original line number Diff line number Diff line
@@ -777,4 +777,16 @@ public class DataProfileManagerTest extends TelephonyTest {
                Telephony.Carriers.MATCH_ALL_APN_SET_ID);
        assertThat(mDataProfileManagerUT.isDataProfileValid(dataProfile)).isTrue();
    }

    @Test
    public void testDefaultEmergencyDataProfileValid() {
        TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder()
                .addCapability(NetworkCapabilities.NET_CAPABILITY_EIMS)
                .build(), mPhone);
        DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
                tnr, TelephonyManager.NETWORK_TYPE_LTE);

        assertThat(dataProfile.getApn()).isEqualTo("sos");
        assertThat(dataProfile.getTrafficDescriptor().getDataNetworkName()).isEqualTo("sos");
    }
}