Loading src/java/com/android/internal/telephony/data/DataProfileManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -684,7 +684,8 @@ public class DataProfileManager extends Handler { return mAllDataProfiles.contains(dataProfile) && (dataProfile.getApnSetting() == null || dataProfile.getApnSetting().getApnSetId() == mPreferredDataProfileSetId || mPreferredDataProfileSetId == Telephony.Carriers.MATCH_ALL_APN_SET_ID); || dataProfile.getApnSetting().getApnSetId() == Telephony.Carriers.MATCH_ALL_APN_SET_ID); } /** Loading tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java +21 −1 Original line number Diff line number Diff line Loading @@ -689,7 +689,6 @@ public class DataProfileManagerTest extends TelephonyTest { @Test public void testDedupeDataProfiles2() throws Exception { DataProfile dataProfile1 = new DataProfile.Builder() .setApnSetting(new ApnSetting.Builder() .setEntryName("general") Loading Loading @@ -756,4 +755,25 @@ public class DataProfileManagerTest extends TelephonyTest { assertThat(dataProfile.getApnSetting().getRoamingProtocol()) .isEqualTo(ApnSetting.PROTOCOL_IPV4V6); } @Test public void testIsDataProfileValid() { TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder() .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) .build(), mPhone); DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest( tnr, TelephonyManager.NETWORK_TYPE_LTE); assertThat(dataProfile.getApnSetting().getApnSetId()).isEqualTo( Telephony.Carriers.NO_APN_SET_ID); assertThat(mDataProfileManagerUT.isDataProfileValid(dataProfile)).isTrue(); tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder() .addCapability(NetworkCapabilities.NET_CAPABILITY_EIMS) .build(), mPhone); dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest( tnr, TelephonyManager.NETWORK_TYPE_LTE); assertThat(dataProfile.getApnSetting().getApnSetId()).isEqualTo( Telephony.Carriers.MATCH_ALL_APN_SET_ID); assertThat(mDataProfileManagerUT.isDataProfileValid(dataProfile)).isTrue(); } } Loading
src/java/com/android/internal/telephony/data/DataProfileManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -684,7 +684,8 @@ public class DataProfileManager extends Handler { return mAllDataProfiles.contains(dataProfile) && (dataProfile.getApnSetting() == null || dataProfile.getApnSetting().getApnSetId() == mPreferredDataProfileSetId || mPreferredDataProfileSetId == Telephony.Carriers.MATCH_ALL_APN_SET_ID); || dataProfile.getApnSetting().getApnSetId() == Telephony.Carriers.MATCH_ALL_APN_SET_ID); } /** Loading
tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java +21 −1 Original line number Diff line number Diff line Loading @@ -689,7 +689,6 @@ public class DataProfileManagerTest extends TelephonyTest { @Test public void testDedupeDataProfiles2() throws Exception { DataProfile dataProfile1 = new DataProfile.Builder() .setApnSetting(new ApnSetting.Builder() .setEntryName("general") Loading Loading @@ -756,4 +755,25 @@ public class DataProfileManagerTest extends TelephonyTest { assertThat(dataProfile.getApnSetting().getRoamingProtocol()) .isEqualTo(ApnSetting.PROTOCOL_IPV4V6); } @Test public void testIsDataProfileValid() { TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder() .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) .build(), mPhone); DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest( tnr, TelephonyManager.NETWORK_TYPE_LTE); assertThat(dataProfile.getApnSetting().getApnSetId()).isEqualTo( Telephony.Carriers.NO_APN_SET_ID); assertThat(mDataProfileManagerUT.isDataProfileValid(dataProfile)).isTrue(); tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder() .addCapability(NetworkCapabilities.NET_CAPABILITY_EIMS) .build(), mPhone); dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest( tnr, TelephonyManager.NETWORK_TYPE_LTE); assertThat(dataProfile.getApnSetting().getApnSetId()).isEqualTo( Telephony.Carriers.MATCH_ALL_APN_SET_ID); assertThat(mDataProfileManagerUT.isDataProfileValid(dataProfile)).isTrue(); } }