Loading src/java/com/android/internal/telephony/data/DataNetwork.java +2 −7 Original line number Diff line number Diff line Loading @@ -1097,12 +1097,7 @@ public class DataNetwork extends StateMachine { mPhone.getPhoneId()); final NetworkProvider provider = (null == factory) ? null : factory.getProvider(); // Always prefer IWLAN network for MMS designated network. // TODO(b/293656884) Proper use of primary transport to avoid conflicting with DSDA. boolean isPreferred = mTransport == AccessNetworkConstants.TRANSPORT_TYPE_WLAN && getApnTypeNetworkCapability() == NetworkCapabilities.NET_CAPABILITY_MMS; mNetworkScore = new NetworkScore.Builder().setTransportPrimary(isPreferred) mNetworkScore = new NetworkScore.Builder() .setKeepConnectedReason(isHandoverInProgress() ? NetworkScore.KEEP_CONNECTED_FOR_HANDOVER : NetworkScore.KEEP_CONNECTED_NONE).build(); Loading src/java/com/android/internal/telephony/data/DataNetworkController.java +0 −22 Original line number Diff line number Diff line Loading @@ -1359,28 +1359,6 @@ public class DataNetworkController extends Handler { // When reaching here, it means this data network can satisfy all the network requests. logv("Found a compatible data network " + dataNetwork + ". Attaching " + requestList); // If WLAN preferred, see whether a more suitable data profile shall be used to satisfy // a short-lived request that doesn't perform handover. int capability = requestList.getFirst().getApnTypeNetworkCapability(); int preferredTransport = mAccessNetworksManager .getPreferredTransportByNetworkCapability(capability); if (capability == NetworkCapabilities.NET_CAPABILITY_MMS && preferredTransport != dataNetwork.getTransport() && preferredTransport == AccessNetworkConstants.TRANSPORT_TYPE_WLAN) { DataProfile candidate = mDataProfileManager .getDataProfileForNetworkRequest(requestList.getFirst(), TelephonyManager.NETWORK_TYPE_IWLAN, mServiceState.isUsingNonTerrestrialNetwork(), isEsimBootStrapProvisioningActivated(), false/*ignorePermanentFailure*/); if (candidate != null && !dataNetwork.getDataProfile().equals(candidate)) { logv("But skipped because found better data profile " + candidate + DataUtils.networkCapabilityToString(capability) + " preferred on " + AccessNetworkConstants.transportTypeToString(preferredTransport)); continue; } } return dataNetwork.attachNetworkRequests(requestList); } return false; Loading tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java +1 −40 Original line number Diff line number Diff line Loading @@ -393,17 +393,6 @@ public class DataNetworkControllerTest extends TelephonyTest { "PRIORITIZE_LATENCY", 1).getBytes())) .build(); private final DataProfile mMmsOnWlanDataProfile = new DataProfile.Builder() .setApnSetting(new ApnSetting.Builder() .setEntryName("mms_wlan") .setApnName("mms_wlan") .setApnTypeBitmask(ApnSetting.TYPE_MMS) .setCarrierEnabled(true) .setNetworkTypeBitmask((int) TelephonyManager.NETWORK_TYPE_BITMASK_IWLAN) .build()) .setPreferred(false) .build(); private final DataProfile mNtnDataProfile = new DataProfile.Builder() .setApnSetting(new ApnSetting.Builder() .setEntryName("ntn") Loading Loading @@ -1002,7 +991,7 @@ public class DataNetworkControllerTest extends TelephonyTest { List<DataProfile> profiles = List.of(mGeneralPurposeDataProfile, mGeneralPurposeDataProfileAlternative, mImsCellularDataProfile, mImsIwlanDataProfile, mEmergencyDataProfile, mFotaDataProfile, mTetheringDataProfile, mMmsOnWlanDataProfile, mLowLatencyDataProfile, mTetheringDataProfile, mLowLatencyDataProfile, mNtnDataProfile, mEsimBootstrapDataProfile, mEsimBootstrapImsProfile, mEsimBootstrapRcsInfraStructureProfile); Loading Loading @@ -5036,34 +5025,6 @@ public class DataNetworkControllerTest extends TelephonyTest { NetworkCapabilities.NET_CAPABILITY_PRIORITIZE_LATENCY)).isTrue(); } @Test public void testAllowBringUpWithDifferentDataProfileForWlan() throws Exception { // Mock MMS preferred on WLAN doReturn(AccessNetworkConstants.TRANSPORT_TYPE_WLAN).when(mAccessNetworksManager) .getPreferredTransportByNetworkCapability(NetworkCapabilities.NET_CAPABILITY_MMS); // Setup a default cellular network that's capable of MMS mDataNetworkControllerUT.addNetworkRequest( createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_INTERNET)); mDataNetworkControllerUT.addNetworkRequest( createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_IMS)); processAllMessages(); verifyConnectedNetworkHasDataProfile(mGeneralPurposeDataProfile); // Mock the designated MMS profile when WLAN is preferred doReturn(mMmsOnWlanDataProfile).when(mDataProfileManager).getDataProfileForNetworkRequest( any(TelephonyNetworkRequest.class), eq(TelephonyManager.NETWORK_TYPE_IWLAN), anyBoolean(), anyBoolean(), anyBoolean()); setSuccessfulSetupDataResponse(mMockedWlanDataServiceManager, createDataCallResponse(2, DataCallResponse.LINK_STATUS_ACTIVE)); // Verify the designated MMS profile is used to satisfy MMS request mDataNetworkControllerUT.addNetworkRequest( createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_MMS)); processAllMessages(); verifyConnectedNetworkHasDataProfile(mMmsOnWlanDataProfile); } @Test public void testNonTerrestrialNetwork() throws Exception { mIsNonTerrestrialNetwork = true; Loading Loading
src/java/com/android/internal/telephony/data/DataNetwork.java +2 −7 Original line number Diff line number Diff line Loading @@ -1097,12 +1097,7 @@ public class DataNetwork extends StateMachine { mPhone.getPhoneId()); final NetworkProvider provider = (null == factory) ? null : factory.getProvider(); // Always prefer IWLAN network for MMS designated network. // TODO(b/293656884) Proper use of primary transport to avoid conflicting with DSDA. boolean isPreferred = mTransport == AccessNetworkConstants.TRANSPORT_TYPE_WLAN && getApnTypeNetworkCapability() == NetworkCapabilities.NET_CAPABILITY_MMS; mNetworkScore = new NetworkScore.Builder().setTransportPrimary(isPreferred) mNetworkScore = new NetworkScore.Builder() .setKeepConnectedReason(isHandoverInProgress() ? NetworkScore.KEEP_CONNECTED_FOR_HANDOVER : NetworkScore.KEEP_CONNECTED_NONE).build(); Loading
src/java/com/android/internal/telephony/data/DataNetworkController.java +0 −22 Original line number Diff line number Diff line Loading @@ -1359,28 +1359,6 @@ public class DataNetworkController extends Handler { // When reaching here, it means this data network can satisfy all the network requests. logv("Found a compatible data network " + dataNetwork + ". Attaching " + requestList); // If WLAN preferred, see whether a more suitable data profile shall be used to satisfy // a short-lived request that doesn't perform handover. int capability = requestList.getFirst().getApnTypeNetworkCapability(); int preferredTransport = mAccessNetworksManager .getPreferredTransportByNetworkCapability(capability); if (capability == NetworkCapabilities.NET_CAPABILITY_MMS && preferredTransport != dataNetwork.getTransport() && preferredTransport == AccessNetworkConstants.TRANSPORT_TYPE_WLAN) { DataProfile candidate = mDataProfileManager .getDataProfileForNetworkRequest(requestList.getFirst(), TelephonyManager.NETWORK_TYPE_IWLAN, mServiceState.isUsingNonTerrestrialNetwork(), isEsimBootStrapProvisioningActivated(), false/*ignorePermanentFailure*/); if (candidate != null && !dataNetwork.getDataProfile().equals(candidate)) { logv("But skipped because found better data profile " + candidate + DataUtils.networkCapabilityToString(capability) + " preferred on " + AccessNetworkConstants.transportTypeToString(preferredTransport)); continue; } } return dataNetwork.attachNetworkRequests(requestList); } return false; Loading
tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java +1 −40 Original line number Diff line number Diff line Loading @@ -393,17 +393,6 @@ public class DataNetworkControllerTest extends TelephonyTest { "PRIORITIZE_LATENCY", 1).getBytes())) .build(); private final DataProfile mMmsOnWlanDataProfile = new DataProfile.Builder() .setApnSetting(new ApnSetting.Builder() .setEntryName("mms_wlan") .setApnName("mms_wlan") .setApnTypeBitmask(ApnSetting.TYPE_MMS) .setCarrierEnabled(true) .setNetworkTypeBitmask((int) TelephonyManager.NETWORK_TYPE_BITMASK_IWLAN) .build()) .setPreferred(false) .build(); private final DataProfile mNtnDataProfile = new DataProfile.Builder() .setApnSetting(new ApnSetting.Builder() .setEntryName("ntn") Loading Loading @@ -1002,7 +991,7 @@ public class DataNetworkControllerTest extends TelephonyTest { List<DataProfile> profiles = List.of(mGeneralPurposeDataProfile, mGeneralPurposeDataProfileAlternative, mImsCellularDataProfile, mImsIwlanDataProfile, mEmergencyDataProfile, mFotaDataProfile, mTetheringDataProfile, mMmsOnWlanDataProfile, mLowLatencyDataProfile, mTetheringDataProfile, mLowLatencyDataProfile, mNtnDataProfile, mEsimBootstrapDataProfile, mEsimBootstrapImsProfile, mEsimBootstrapRcsInfraStructureProfile); Loading Loading @@ -5036,34 +5025,6 @@ public class DataNetworkControllerTest extends TelephonyTest { NetworkCapabilities.NET_CAPABILITY_PRIORITIZE_LATENCY)).isTrue(); } @Test public void testAllowBringUpWithDifferentDataProfileForWlan() throws Exception { // Mock MMS preferred on WLAN doReturn(AccessNetworkConstants.TRANSPORT_TYPE_WLAN).when(mAccessNetworksManager) .getPreferredTransportByNetworkCapability(NetworkCapabilities.NET_CAPABILITY_MMS); // Setup a default cellular network that's capable of MMS mDataNetworkControllerUT.addNetworkRequest( createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_INTERNET)); mDataNetworkControllerUT.addNetworkRequest( createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_IMS)); processAllMessages(); verifyConnectedNetworkHasDataProfile(mGeneralPurposeDataProfile); // Mock the designated MMS profile when WLAN is preferred doReturn(mMmsOnWlanDataProfile).when(mDataProfileManager).getDataProfileForNetworkRequest( any(TelephonyNetworkRequest.class), eq(TelephonyManager.NETWORK_TYPE_IWLAN), anyBoolean(), anyBoolean(), anyBoolean()); setSuccessfulSetupDataResponse(mMockedWlanDataServiceManager, createDataCallResponse(2, DataCallResponse.LINK_STATUS_ACTIVE)); // Verify the designated MMS profile is used to satisfy MMS request mDataNetworkControllerUT.addNetworkRequest( createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_MMS)); processAllMessages(); verifyConnectedNetworkHasDataProfile(mMmsOnWlanDataProfile); } @Test public void testNonTerrestrialNetwork() throws Exception { mIsNonTerrestrialNetwork = true; Loading