Revert "[eSIM BootStrap Support] Support esim bootstrap provisio..."
Revert submission 24820655-esim_profile_support_v1.0
Reason for revert: Found regression with b/309044670
Reverted changes: /q/submissionid:24820655-esim_profile_support_v1.0
Change-Id: Ic9fcd0c98225d73021eb17a44ceeae5611092fd2
diff --git a/flags/uicc.aconfig b/flags/uicc.aconfig
index 3ef2301..39b344b 100644
--- a/flags/uicc.aconfig
+++ b/flags/uicc.aconfig
@@ -1,11 +1,4 @@
package: "com.android.internal.telephony.flags"
-
-flag {
- name: "esim_bootstrap_provisioning_flag"
- namespace: "telephony"
- description: "This flag controls eSIM Bootstrap provisioning feature support."
- bug:"298567545"
-}
flag {
name: "imsi_key_retry_download_on_phone_unlock"
namespace: "telephony"
diff --git a/src/java/com/android/internal/telephony/data/DataNetwork.java b/src/java/com/android/internal/telephony/data/DataNetwork.java
index 4cf5ef9..0c5c9cb 100644
--- a/src/java/com/android/internal/telephony/data/DataNetwork.java
+++ b/src/java/com/android/internal/telephony/data/DataNetwork.java
@@ -2290,10 +2290,6 @@
}
}
- if (mDataNetworkController.isEsimBootStrapProvisioningActivated()) {
- builder.removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED);
- }
-
// If one of the capabilities are for special use, for example, IMS, CBS, then this
// network should be restricted, regardless data is enabled or not.
if (NetworkCapabilitiesUtils.inferRestrictedCapability(builder.build())
@@ -3322,8 +3318,7 @@
TelephonyNetworkRequest networkRequest = mAttachedNetworkRequestList.get(0);
DataProfile dataProfile = mDataNetworkController.getDataProfileManager()
.getDataProfileForNetworkRequest(networkRequest, targetNetworkType,
- mPhone.getServiceState().isUsingNonTerrestrialNetwork(),
- mDataNetworkController.isEsimBootStrapProvisioningActivated(), false);
+ mPhone.getServiceState().isUsingNonTerrestrialNetwork(), false);
// Some carriers have different profiles between cellular and IWLAN. We need to
// dynamically switch profile, but only when those profiles have same APN name.
if (dataProfile != null && dataProfile.getApnSetting() != null
diff --git a/src/java/com/android/internal/telephony/data/DataNetworkController.java b/src/java/com/android/internal/telephony/data/DataNetworkController.java
index c29afa6..2d91967 100644
--- a/src/java/com/android/internal/telephony/data/DataNetworkController.java
+++ b/src/java/com/android/internal/telephony/data/DataNetworkController.java
@@ -101,8 +101,6 @@
import com.android.internal.telephony.data.LinkBandwidthEstimator.LinkBandwidthEstimatorCallback;
import com.android.internal.telephony.flags.FeatureFlags;
import com.android.internal.telephony.ims.ImsResolver;
-import com.android.internal.telephony.subscription.SubscriptionInfoInternal;
-import com.android.internal.telephony.subscription.SubscriptionManagerService;
import com.android.internal.telephony.util.TelephonyUtils;
import com.android.telephony.Rlog;
@@ -1332,7 +1330,6 @@
.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
@@ -1497,8 +1494,7 @@
evaluation.addDataAllowedReason(DataAllowedReason.EMERGENCY_REQUEST);
evaluation.setCandidateDataProfile(mDataProfileManager.getDataProfileForNetworkRequest(
networkRequest, getDataNetworkType(transport),
- mServiceState.isUsingNonTerrestrialNetwork(),
- isEsimBootStrapProvisioningActivated(), true));
+ mServiceState.isUsingNonTerrestrialNetwork(), true));
networkRequest.setEvaluation(evaluation);
log(evaluation.toString());
return evaluation;
@@ -1657,7 +1653,6 @@
DataProfile dataProfile = mDataProfileManager
.getDataProfileForNetworkRequest(networkRequest, networkType,
mServiceState.isUsingNonTerrestrialNetwork(),
- isEsimBootStrapProvisioningActivated(),
// If the evaluation is due to environmental changes, then we should ignore
// the permanent failure reached earlier.
reason.isConditionBased());
@@ -2277,22 +2272,6 @@
}
/**
- * Check if the device is in eSIM bootstrap provisioning state.
- *
- * @return {@code true} if the device is under eSIM bootstrap provisioning.
- */
- public boolean isEsimBootStrapProvisioningActivated() {
- if (!mFeatureFlags.esimBootstrapProvisioningFlag()) {
- return false;
- }
-
- SubscriptionInfoInternal subInfo = SubscriptionManagerService.getInstance()
- .getSubscriptionInfoInternal(mPhone.getSubId());
- return subInfo != null
- && subInfo.getProfileClass() == SubscriptionManager.PROFILE_CLASS_PROVISIONING;
- }
-
- /**
* Register for IMS feature registration state.
*
* @param subId The subscription index.
diff --git a/src/java/com/android/internal/telephony/data/DataProfileManager.java b/src/java/com/android/internal/telephony/data/DataProfileManager.java
index df1fc92..273dc8b 100644
--- a/src/java/com/android/internal/telephony/data/DataProfileManager.java
+++ b/src/java/com/android/internal/telephony/data/DataProfileManager.java
@@ -255,7 +255,6 @@
cursor.close();
return dataProfile;
}
-
/**
* Update all data profiles, including preferred data profile, and initial attach data profile.
* Also send those profiles down to the modem if needed.
@@ -641,12 +640,12 @@
*/
public @Nullable DataProfile getDataProfileForNetworkRequest(
@NonNull TelephonyNetworkRequest networkRequest, @NetworkType int networkType,
- boolean isNtn, boolean isEsimBootstrapProvisioning, boolean ignorePermanentFailure) {
+ boolean isNtn, boolean ignorePermanentFailure) {
ApnSetting apnSetting = null;
if (networkRequest.hasAttribute(TelephonyNetworkRequest
.CAPABILITY_ATTRIBUTE_APN_SETTING)) {
apnSetting = getApnSettingForNetworkRequest(networkRequest, networkType, isNtn,
- isEsimBootstrapProvisioning, ignorePermanentFailure);
+ ignorePermanentFailure);
}
TrafficDescriptor.Builder trafficDescriptorBuilder = new TrafficDescriptor.Builder();
@@ -712,52 +711,48 @@
*/
private @Nullable ApnSetting getApnSettingForNetworkRequest(
@NonNull TelephonyNetworkRequest networkRequest, @NetworkType int networkType,
- boolean isNtn, boolean isEsimBootStrapProvisioning, boolean ignorePermanentFailure) {
+ boolean isNtn, boolean ignorePermanentFailure) {
if (!networkRequest.hasAttribute(
TelephonyNetworkRequest.CAPABILITY_ATTRIBUTE_APN_SETTING)) {
loge("Network request does not have APN setting attribute.");
return null;
}
- // if esim bootstrap provisioning in progress, do not apply preferred data profile
- if (!isEsimBootStrapProvisioning) {
- if (mFeatureFlags.carrierEnabledSatelliteFlag()) {
- // If the preferred data profile can be used, always use it if it can satisfy the
- // network request with current network type (even though it's been marked as
- // permanent failed.)
- if (mPreferredDataProfile != null
- && networkRequest.canBeSatisfiedBy(mPreferredDataProfile)
- && mPreferredDataProfile.getApnSetting() != null
- && mPreferredDataProfile.getApnSetting().canSupportNetworkType(networkType)
- && ((isNtn && mPreferredDataProfile.getApnSetting().isForInfrastructure(
- ApnSetting.INFRASTRUCTURE_SATELLITE))
- || (!isNtn && mPreferredDataProfile.getApnSetting().isForInfrastructure(
- ApnSetting.INFRASTRUCTURE_CELLULAR)))) {
- if (ignorePermanentFailure || !mPreferredDataProfile.getApnSetting()
- .getPermanentFailed()) {
- return mPreferredDataProfile.getApnSetting();
- }
- log("The preferred data profile is permanently failed. Only condition based "
- + "retry can happen.");
- return null;
+ if (mFeatureFlags.carrierEnabledSatelliteFlag()) {
+ // If the preferred data profile can be used, always use it if it can satisfy the
+ // network request with current network type (even though it's been marked as permanent
+ // failed.)
+ if (mPreferredDataProfile != null
+ && networkRequest.canBeSatisfiedBy(mPreferredDataProfile)
+ && mPreferredDataProfile.getApnSetting() != null
+ && mPreferredDataProfile.getApnSetting().canSupportNetworkType(networkType)
+ && ((isNtn && mPreferredDataProfile.getApnSetting().isForInfrastructure(
+ ApnSetting.INFRASTRUCTURE_SATELLITE))
+ || (!isNtn && mPreferredDataProfile.getApnSetting().isForInfrastructure(
+ ApnSetting.INFRASTRUCTURE_CELLULAR)))) {
+ if (ignorePermanentFailure || !mPreferredDataProfile.getApnSetting()
+ .getPermanentFailed()) {
+ return mPreferredDataProfile.getApnSetting();
}
- } else {
- // If the preferred data profile can be used, always use it if it can satisfy the
- // network request with current network type (even though it's been marked as
- // permanent failed.)
- if (mPreferredDataProfile != null
- && networkRequest.canBeSatisfiedBy(mPreferredDataProfile)
- && mPreferredDataProfile.getApnSetting() != null
- && mPreferredDataProfile.getApnSetting()
- .canSupportNetworkType(networkType)) {
- if (ignorePermanentFailure || !mPreferredDataProfile.getApnSetting()
- .getPermanentFailed()) {
- return mPreferredDataProfile.getApnSetting();
- }
- log("The preferred data profile is permanently failed. Only condition based "
- + "retry can happen.");
- return null;
+ log("The preferred data profile is permanently failed. Only condition based "
+ + "retry can happen.");
+ return null;
+ }
+ } else {
+ // If the preferred data profile can be used, always use it if it can satisfy the
+ // network request with current network type (even though it's been marked as permanent
+ // failed.)
+ if (mPreferredDataProfile != null
+ && networkRequest.canBeSatisfiedBy(mPreferredDataProfile)
+ && mPreferredDataProfile.getApnSetting() != null
+ && mPreferredDataProfile.getApnSetting().canSupportNetworkType(networkType)) {
+ if (ignorePermanentFailure || !mPreferredDataProfile.getApnSetting()
+ .getPermanentFailed()) {
+ return mPreferredDataProfile.getApnSetting();
}
+ log("The preferred data profile is permanently failed. Only condition based "
+ + "retry can happen.");
+ return null;
}
}
@@ -783,8 +778,6 @@
.filter((dp) -> {
if (dp.getApnSetting() == null) return false;
if (!dp.getApnSetting().canSupportNetworkType(networkType)) return false;
- if (isEsimBootStrapProvisioning
- != dp.getApnSetting().isEsimBootstrapProvisioning()) return false;
if (mFeatureFlags.carrierEnabledSatelliteFlag()) {
if (isNtn && !dp.getApnSetting().isForInfrastructure(
ApnSetting.INFRASTRUCTURE_SATELLITE)) {
@@ -827,10 +820,6 @@
return null;
}
- if (isEsimBootStrapProvisioning) {
- log("Found esim bootstrap provisioning data profile for network request: "
- + dataProfiles.get(0).getApnSetting());
- }
return dataProfiles.get(0).getApnSetting();
}
@@ -876,9 +865,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_DUN)
.build(), mPhone);
return getDataProfileForNetworkRequest(networkRequest, networkType,
- mPhone.getServiceState().isUsingNonTerrestrialNetwork(),
- mDataNetworkController.isEsimBootStrapProvisioningActivated(),
- true) != null;
+ mPhone.getServiceState().isUsingNonTerrestrialNetwork(), true) != null;
}
/**
@@ -1053,8 +1040,6 @@
apnBuilder.setCarrierId(apn1.getCarrierId());
apnBuilder.setSkip464Xlat(apn1.getSkip464Xlat());
apnBuilder.setAlwaysOn(apn1.isAlwaysOn());
- apnBuilder.setInfrastructureBitmask(apn1.getInfrastructureBitmask());
- apnBuilder.setEsimBootstrapProvisioning(apn1.isEsimBootstrapProvisioning());
return new DataProfile.Builder()
.setApnSetting(apnBuilder.build())
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java
index 01a82ba..a09994b 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java
@@ -415,47 +415,6 @@
.setPreferred(false)
.build();
- private final DataProfile mEsimBootstrapDataProfile = new DataProfile.Builder()
- .setApnSetting(new ApnSetting.Builder()
- .setEntryName("ESIM BOOTSTRAP")
- .setApnName("ESIM BOOTSTRAP")
- .setApnTypeBitmask(ApnSetting.TYPE_DEFAULT)
- .setNetworkTypeBitmask((int) TelephonyManager.NETWORK_TYPE_BITMASK_LTE
- | (int) TelephonyManager.NETWORK_TYPE_BITMASK_NR)
- .setCarrierEnabled(true)
- .setEsimBootstrapProvisioning(true)
- .build())
- .setPreferred(false)
- .build();
-
- private final DataProfile mEsimBootstrapImsProfile = new DataProfile.Builder()
- .setApnSetting(new ApnSetting.Builder()
- .setEntryName("IMS BOOTSTRAP")
- .setApnName("IMS BOOTSTRAP")
- .setApnTypeBitmask(ApnSetting.TYPE_IMS)
- .setNetworkTypeBitmask((int) TelephonyManager.NETWORK_TYPE_BITMASK_LTE
- | (int) TelephonyManager.NETWORK_TYPE_BITMASK_NR)
- .setCarrierEnabled(true)
- .setEsimBootstrapProvisioning(true)
- .build())
- .setPreferred(false)
- .build();
-
- private final DataProfile mEsimBootstrapRcsInfraStructureProfile =
- new DataProfile.Builder()
- .setApnSetting(new ApnSetting.Builder()
- .setEntryName("INFRASTRUCTURE BOOTSTRAP")
- .setApnName("INFRASTRUCTURE BOOTSTRAP")
- .setApnTypeBitmask(ApnSetting.TYPE_RCS)
- .setNetworkTypeBitmask((int) TelephonyManager.NETWORK_TYPE_BITMASK_LTE
- | (int) TelephonyManager.NETWORK_TYPE_BITMASK_NR)
- .setCarrierEnabled(true)
- .setInfrastructureBitmask(2)
- .setEsimBootstrapProvisioning(true)
- .build())
- .setPreferred(false)
- .build();
-
/** Data call response map. The first key is the transport type, the second key is the cid. */
private final Map<Integer, Map<Integer, DataCallResponse>> mDataCallResponses = new HashMap<>();
@@ -960,8 +919,7 @@
mGeneralPurposeDataProfileAlternative, mImsCellularDataProfile,
mImsIwlanDataProfile, mEmergencyDataProfile, mFotaDataProfile,
mTetheringDataProfile, mMmsOnWlanDataProfile, mLowLatencyDataProfile,
- mNtnDataProfile, mEsimBootstrapDataProfile,
- mEsimBootstrapImsProfile, mEsimBootstrapRcsInfraStructureProfile);
+ mNtnDataProfile);
doAnswer(invocation -> {
DataProfile dp = (DataProfile) invocation.getArguments()[0];
@@ -993,8 +951,7 @@
(TelephonyNetworkRequest) invocation.getArguments()[0];
int networkType = (int) invocation.getArguments()[1];
boolean isNtn = (boolean) invocation.getArguments()[2];
- boolean isEsimBootstrapProvisioning = (boolean) invocation.getArguments()[3];
- boolean ignorePermanentFailure = (boolean) invocation.getArguments()[4];
+ boolean ignorePermanentFailure = (boolean) invocation.getArguments()[3];
for (DataProfile dataProfile : profiles) {
ApnSetting apnSetting = dataProfile.getApnSetting();
@@ -1003,24 +960,20 @@
&& (apnSetting.getNetworkTypeBitmask() == 0
|| (apnSetting.getNetworkTypeBitmask()
& ServiceState.getBitmaskForTech(networkType)) != 0)
- && (isEsimBootstrapProvisioning
- == apnSetting.isEsimBootstrapProvisioning())
&& ((isNtn && apnSetting.isForInfrastructure(
- ApnSetting.INFRASTRUCTURE_SATELLITE))
- || (!isNtn && apnSetting.isForInfrastructure(
- ApnSetting.INFRASTRUCTURE_CELLULAR)))
+ ApnSetting.INFRASTRUCTURE_SATELLITE))
+ || ((!isNtn && apnSetting.isForInfrastructure(
+ ApnSetting.INFRASTRUCTURE_CELLULAR))))
&& (ignorePermanentFailure || !apnSetting.getPermanentFailed())) {
return dataProfile;
}
}
logd("Cannot find data profile to satisfy " + networkRequest + ", network type="
+ TelephonyManager.getNetworkTypeName(networkType) + ", ignorePermanentFailure="
- + ignorePermanentFailure + ", isNtn=" + isNtn + ","
- + "isEsimBootstrapProvisioning=" + isEsimBootstrapProvisioning);
+ + ignorePermanentFailure + ", isNtn=" + isNtn);
return null;
}).when(mDataProfileManager).getDataProfileForNetworkRequest(
- any(TelephonyNetworkRequest.class), anyInt(), anyBoolean(), anyBoolean(),
- anyBoolean());
+ any(TelephonyNetworkRequest.class), anyInt(), anyBoolean(), anyBoolean());
doReturn(AccessNetworkConstants.TRANSPORT_TYPE_WWAN).when(mAccessNetworksManager)
.getPreferredTransportByNetworkCapability(anyInt());
@@ -1228,18 +1181,6 @@
+ dataNetworkList);
}
- private void verifyConnectedNetworkHasNoDataProfile(@NonNull DataProfile dataProfile)
- throws Exception {
- List<DataNetwork> dataNetworkList = getDataNetworks();
- for (DataNetwork dataNetwork : getDataNetworks()) {
- if (dataNetwork.isConnected() && dataNetwork.getDataProfile().equals(dataProfile)) {
- fail("network with " + dataProfile + " is connected. dataNetworkList="
- + dataNetworkList);
- }
- }
- return;
- }
-
private void verifyAllDataDisconnected() throws Exception {
List<DataNetwork> dataNetworkList = getDataNetworks();
assertWithMessage("All data should be disconnected but it's not. " + dataNetworkList)
@@ -1314,8 +1255,7 @@
+ TelephonyManager.getNetworkTypeName(networkType));
return null;
}).when(mDataProfileManager).getDataProfileForNetworkRequest(
- any(TelephonyNetworkRequest.class), anyInt(), anyBoolean(), anyBoolean(),
- anyBoolean());
+ any(TelephonyNetworkRequest.class), anyInt(), anyBoolean(), anyBoolean());
// verify the network still connects
verify(mMockedDataNetworkControllerCallback).onConnectedInternetDataNetworksChanged(any());
@@ -1360,7 +1300,7 @@
createDataCallResponse(1, DataCallResponse.LINK_STATUS_ACTIVE, tdList));
doReturn(mEnterpriseDataProfile).when(mDataProfileManager)
.getDataProfileForNetworkRequest(any(TelephonyNetworkRequest.class), anyInt(),
- anyBoolean(), anyBoolean(), anyBoolean());
+ anyBoolean(), anyBoolean());
NetworkCapabilities netCaps = new NetworkCapabilities();
netCaps.addCapability(NetworkCapabilities.NET_CAPABILITY_ENTERPRISE);
@@ -1575,7 +1515,7 @@
// Now RAT changes from UMTS to GSM
doReturn(null).when(mDataProfileManager).getDataProfileForNetworkRequest(
any(TelephonyNetworkRequest.class), eq(TelephonyManager.NETWORK_TYPE_GSM),
- anyBoolean(), anyBoolean(), anyBoolean());
+ anyBoolean(), anyBoolean());
serviceStateChanged(TelephonyManager.NETWORK_TYPE_GSM,
NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
verifyAllDataDisconnected();
@@ -1589,14 +1529,14 @@
// Now RAT changes from GSM to UMTS
doReturn(null).when(mDataProfileManager).getDataProfileForNetworkRequest(
any(TelephonyNetworkRequest.class), eq(TelephonyManager.NETWORK_TYPE_UMTS),
- anyBoolean(), anyBoolean(), anyBoolean());
+ anyBoolean(), anyBoolean());
serviceStateChanged(TelephonyManager.NETWORK_TYPE_UMTS,
NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
verifyNoConnectedNetworkHasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);
doReturn(mGeneralPurposeDataProfile).when(mDataProfileManager)
.getDataProfileForNetworkRequest(any(TelephonyNetworkRequest.class), anyInt(),
- anyBoolean(), anyBoolean(), anyBoolean());
+ anyBoolean(), anyBoolean());
// Now RAT changes from UMTS to LTE
serviceStateChanged(TelephonyManager.NETWORK_TYPE_LTE,
NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
@@ -3591,7 +3531,7 @@
createDataCallResponse(1, DataCallResponse.LINK_STATUS_ACTIVE, tdList));
doReturn(mEnterpriseDataProfile).when(mDataProfileManager)
.getDataProfileForNetworkRequest(any(TelephonyNetworkRequest.class), anyInt(),
- anyBoolean(), anyBoolean(), anyBoolean());
+ anyBoolean(), anyBoolean());
NetworkCapabilities netCaps = new NetworkCapabilities();
netCaps.addCapability(NetworkCapabilities.NET_CAPABILITY_ENTERPRISE);
@@ -4653,7 +4593,7 @@
createDataCallResponse(1, DataCallResponse.LINK_STATUS_ACTIVE, tdList));
doReturn(mEnterpriseDataProfile).when(mDataProfileManager)
.getDataProfileForNetworkRequest(any(TelephonyNetworkRequest.class), anyInt(),
- anyBoolean(), anyBoolean(), anyBoolean());
+ anyBoolean(), anyBoolean());
mDataNetworkControllerUT.addNetworkRequest(new TelephonyNetworkRequest(
new NetworkRequest.Builder()
.addCapability(NetworkCapabilities.NET_CAPABILITY_ENTERPRISE)
@@ -4691,7 +4631,7 @@
createDataCallResponse(2, DataCallResponse.LINK_STATUS_ACTIVE, tdList));
doReturn(mLowLatencyDataProfile).when(mDataProfileManager)
.getDataProfileForNetworkRequest(any(TelephonyNetworkRequest.class), anyInt(),
- anyBoolean(), anyBoolean(), anyBoolean());
+ anyBoolean(), anyBoolean());
processAllFutureMessages();
dataNetworkList = getDataNetworks();
@@ -4724,7 +4664,7 @@
// 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());
+ anyBoolean(), anyBoolean());
setSuccessfulSetupDataResponse(mMockedWlanDataServiceManager,
createDataCallResponse(2, DataCallResponse.LINK_STATUS_ACTIVE));
@@ -4746,132 +4686,4 @@
processAllMessages();
verifyConnectedNetworkHasDataProfile(mNtnDataProfile);
}
-
- @Test
- public void testIsEsimBootStrapProvisioningActivatedWithFlagEnabledAndProvisioningClass() {
- when(mFeatureFlags.esimBootstrapProvisioningFlag()).thenReturn(true);
- doReturn(new SubscriptionInfoInternal.Builder().setId(1)
- .setProfileClass(SubscriptionManager.PROFILE_CLASS_PROVISIONING).build())
- .when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
-
- assertThat(mDataNetworkControllerUT.isEsimBootStrapProvisioningActivated()).isTrue();
- }
-
- @Test
- public void testIsEsimBootStrapProvisioningActivatedWithFlagEnabledAndNoProvisioningClass() {
- when(mFeatureFlags.esimBootstrapProvisioningFlag()).thenReturn(true);
- doReturn(new SubscriptionInfoInternal.Builder().setId(1)
- .setProfileClass(SubscriptionManager.PROFILE_CLASS_UNSET).build())
- .when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
-
- assertThat(mDataNetworkControllerUT.isEsimBootStrapProvisioningActivated()).isFalse();
- }
-
- @Test
- public void testIsEsimBootStrapProvisioningActivatedWithFlagDisabledAndNoProvisioningClass() {
- when(mFeatureFlags.esimBootstrapProvisioningFlag()).thenReturn(false);
- doReturn(new SubscriptionInfoInternal.Builder().setId(1)
- .setProfileClass(SubscriptionManager.PROFILE_CLASS_UNSET).build())
- .when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
-
- assertThat(mDataNetworkControllerUT.isEsimBootStrapProvisioningActivated()).isFalse();
- }
-
- @Test
- public void testIsEsimBootStrapProvisioningActivatedWithFlagDisabledAndProvisioningClass() {
- when(mFeatureFlags.esimBootstrapProvisioningFlag()).thenReturn(false);
- doReturn(new SubscriptionInfoInternal.Builder().setId(1)
- .setProfileClass(SubscriptionManager.PROFILE_CLASS_PROVISIONING).build())
- .when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
-
- assertThat(mDataNetworkControllerUT.isEsimBootStrapProvisioningActivated()).isFalse();
- }
-
- @Test
- public void testNetworkOnProvisioningProfileClass_WithFlagEnabled() throws Exception {
- when(mFeatureFlags.esimBootstrapProvisioningFlag()).thenReturn(true);
- doReturn(new SubscriptionInfoInternal.Builder().setId(1)
- .setProfileClass(SubscriptionManager.PROFILE_CLASS_PROVISIONING).build())
- .when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
- serviceStateChanged(TelephonyManager.NETWORK_TYPE_LTE,
- NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
- mDataNetworkControllerUT.addNetworkRequest(
- createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_INTERNET));
- processAllMessages();
- verifyConnectedNetworkHasDataProfile(mEsimBootstrapDataProfile);
-
- mDataNetworkControllerUT.addNetworkRequest(
- createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_IMS,
- NetworkCapabilities.NET_CAPABILITY_MMTEL));
- setSuccessfulSetupDataResponse(mMockedDataServiceManagers
- .get(AccessNetworkConstants.TRANSPORT_TYPE_WWAN), 2);
- processAllMessages();
- verifyConnectedNetworkHasDataProfile(mEsimBootstrapImsProfile);
-
- serviceStateChanged(TelephonyManager.NETWORK_TYPE_LTE,
- NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
- mDataNetworkControllerUT.addNetworkRequest(
- createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_RCS));
- processAllMessages();
- verifyNoConnectedNetworkHasCapability(NetworkCapabilities.NET_CAPABILITY_RCS);
- }
-
- @Test
- public void testNetworkOnNonProvisioningProfileClass_WithFlagEnabled() throws Exception {
- when(mFeatureFlags.esimBootstrapProvisioningFlag()).thenReturn(true);
- doReturn(new SubscriptionInfoInternal.Builder().setId(1)
- .setProfileClass(SubscriptionManager.PROFILE_CLASS_UNSET).build())
- .when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
- serviceStateChanged(TelephonyManager.NETWORK_TYPE_LTE,
- NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
- mDataNetworkControllerUT.addNetworkRequest(
- createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_INTERNET));
- processAllMessages();
- verifyConnectedNetworkHasNoDataProfile(mEsimBootstrapDataProfile);
-
- mDataNetworkControllerUT.addNetworkRequest(
- createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_IMS,
- NetworkCapabilities.NET_CAPABILITY_MMTEL));
- setSuccessfulSetupDataResponse(mMockedDataServiceManagers
- .get(AccessNetworkConstants.TRANSPORT_TYPE_WWAN), 2);
- processAllMessages();
- verifyConnectedNetworkHasNoDataProfile(mEsimBootstrapImsProfile);
- }
-
- @Test
- public void testNtnNetworkOnProvisioningProfileClass_WithFlagEnabled() throws Exception {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
- when(mFeatureFlags.esimBootstrapProvisioningFlag()).thenReturn(true);
- doReturn(new SubscriptionInfoInternal.Builder().setId(1)
- .setProfileClass(SubscriptionManager.PROFILE_CLASS_PROVISIONING).build())
- .when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
- mIsNonTerrestrialNetwork = true;
- serviceStateChanged(TelephonyManager.NETWORK_TYPE_LTE,
- NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
- mDataNetworkControllerUT.addNetworkRequest(
- createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_RCS));
- processAllMessages();
-
- assertThat(mDataNetworkControllerUT.isEsimBootStrapProvisioningActivated()).isTrue();
- verifyConnectedNetworkHasNoDataProfile(mNtnDataProfile);
- verifyConnectedNetworkHasDataProfile(mEsimBootstrapRcsInfraStructureProfile);
- }
-
- @Test
- public void testNonNtnNetworkOnProvisioningProfileClass_WithFlagEnabled() throws Exception {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
- when(mFeatureFlags.esimBootstrapProvisioningFlag()).thenReturn(true);
- doReturn(new SubscriptionInfoInternal.Builder().setId(1)
- .setProfileClass(SubscriptionManager.PROFILE_CLASS_PROVISIONING).build())
- .when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
- serviceStateChanged(TelephonyManager.NETWORK_TYPE_LTE,
- NetworkRegistrationInfo.REGISTRATION_STATE_HOME);
- mDataNetworkControllerUT.addNetworkRequest(
- createNetworkRequest(NetworkCapabilities.NET_CAPABILITY_RCS));
- processAllMessages();
-
- assertThat(mDataNetworkControllerUT.isEsimBootStrapProvisioningActivated()).isTrue();
- verifyConnectedNetworkHasNoDataProfile(mNtnDataProfile);
- verifyConnectedNetworkHasNoDataProfile(mEsimBootstrapRcsInfraStructureProfile);
- }
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
index f8d22cd..f9a11be 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
@@ -84,12 +84,8 @@
private static final String TETHERING_APN = "DUN_APN";
private static final String APN_SET_ID_1_APN = "APN_SET_ID_1_APN";
private static final String RCS_APN = "RCS_APN";
- private static final String RCS_APN1 = "RCS_APN1";
private static final String APN_SET_ID_1_TETHERING_APN = "APN_SET_ID_1_TETHERING_APN";
private static final String MATCH_ALL_APN_SET_ID_IMS_APN = "MATCH_ALL_APN_SET_ID_IMS_APN";
- private static final String ESIM_BOOTSTRAP_PROVISIONING_APN = "ESIM_BOOTSTRAP_PROVISIONING_APN";
- private static final String TEST_BOOTSTRAP_APN =
- "TEST_BOOTSTRAP_APN";
private static final String PLMN = "330123";
private static final int DEFAULT_APN_SET_ID = Telephony.Carriers.NO_APN_SET_ID;
private static final int APN_SET_ID_1 = 1;
@@ -141,8 +137,7 @@
Telephony.Carriers.CARRIER_ID,
Telephony.Carriers.SKIP_464XLAT,
Telephony.Carriers.ALWAYS_ON,
- Telephony.Carriers.INFRASTRUCTURE_BITMASK,
- Telephony.Carriers.ESIM_BOOTSTRAP_PROVISIONING
+ Telephony.Carriers.INFRASTRUCTURE_BITMASK
};
private int mPreferredApnSet = 0;
@@ -182,8 +177,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
// default internet data profile for RAT CDMA, to test update preferred data profile
new Object[]{
@@ -219,8 +213,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
new Object[]{
2, // id
@@ -255,8 +248,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
new Object[]{
3, // id
@@ -291,8 +283,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
new Object[]{
4, // id
@@ -328,8 +319,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
// This APN entry is created to test de-duping.
new Object[]{
@@ -366,8 +356,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
new Object[]{
6, // id
@@ -403,8 +392,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
new Object[]{
7, // id
@@ -440,8 +428,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
new Object[]{
8, // id
@@ -477,8 +464,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 0 // esim_bootstrap_provisioning
+ 1 // INFRASTRUCTURE_CELLULAR
},
new Object[]{
9, // id
@@ -514,156 +500,7 @@
-1, // carrier_id
-1, // skip_464xlat
0, // always_on
- 2, // INFRASTRUCTURE_SATELLITE
- 0 // esim_bootstrap_provisioning
- },
- new Object[]{
- 10, // id
- PLMN, // numeric
- ESIM_BOOTSTRAP_PROVISIONING_APN, // name
- ESIM_BOOTSTRAP_PROVISIONING_APN, // apn
- "", // proxy
- "", // port
- "", // mmsc
- "", // mmsproxy
- "", // mmsport
- "", // user
- "", // password
- -1, // authtype
- "default,supl", // types
- "IPV4V6", // protocol
- "IPV4V6", // roaming_protocol
- 1, // carrier_enabled
- 0, // profile_id
- 1, // modem_cognitive
- 0, // max_conns
- 0, // wait_time
- 0, // max_conns_time
- 0, // mtu
- 1280, // mtu_v4
- 1280, // mtu_v6
- "", // mvno_type
- "", // mnvo_match_data
- TelephonyManager.NETWORK_TYPE_BITMASK_LTE
- | TelephonyManager.NETWORK_TYPE_BITMASK_NR, // network_type_bitmask
- 0, // lingering_network_type_bitmask
- MATCH_ALL_APN_SET_ID, // apn_set_id
- -1, // carrier_id
- -1, // skip_464xlat
- 0, // always_on
- 1, // INFRASTRUCTURE_CELLULAR
- 1 // esim_bootstrap_provisioning
- },
- new Object[]{
- 11, // id
- PLMN, // numeric
- IMS_APN, // name
- IMS_APN, // apn
- "", // proxy
- "", // port
- "", // mmsc
- "", // mmsproxy
- "", // mmsport
- "", // user
- "", // password
- -1, // authtype
- "ims", // types
- "IPV4V6", // protocol
- "IPV4V6", // roaming_protocol
- 1, // carrier_enabled
- 0, // profile_id
- 1, // modem_cognitive
- 0, // max_conns
- 0, // wait_time
- 0, // max_conns_time
- 0, // mtu
- 1280, // mtu_v4
- 1280, // mtu_v6
- "", // mvno_type
- "", // mnvo_match_data
- TelephonyManager.NETWORK_TYPE_BITMASK_LTE
- | TelephonyManager.NETWORK_TYPE_BITMASK_NR, // network_type_bitmask
- 0, // lingering_network_type_bitmask
- MATCH_ALL_APN_SET_ID, // apn_set_id
- -1, // carrier_id
- -1, // skip_464xlat
- 0, // always_on
- 1, // INFRASTRUCTURE_SATELLITE
- 1 // esim_bootstrap_provisioning
- },
- new Object[]{
- 12, // id
- PLMN, // numeric
- TEST_BOOTSTRAP_APN, // name
- TEST_BOOTSTRAP_APN, // apn
- "", // proxy
- "", // port
- "", // mmsc
- "", // mmsproxy
- "", // mmsport
- "", // user
- "", // password
- -1, // authtype
- "default", // types
- "IPV4V6", // protocol
- "IPV4V6", // roaming_protocol
- 1, // carrier_enabled
- 0, // profile_id
- 1, // modem_cognitive
- 0, // max_conns
- 0, // wait_time
- 0, // max_conns_time
- 0, // mtu
- 1280, // mtu_v4
- 1280, // mtu_v6
- "", // mvno_type
- "", // mnvo_match_data
- TelephonyManager.NETWORK_TYPE_BITMASK_LTE
- | TelephonyManager.NETWORK_TYPE_BITMASK_NR, // network_type_bitmask
- 0, // lingering_network_type_bitmask
- MATCH_ALL_APN_SET_ID, // apn_set_id
- -1, // carrier_id
- -1, // skip_464xlat
- 0, // always_on
- 2, // INFRASTRUCTURE_SATELLITE
- 1 // esim_bootstrap_provisioning
- },
- new Object[]{
- 13, // id
- PLMN, // numeric
- RCS_APN1, // name
- RCS_APN1, // apn
- "", // proxy
- "", // port
- "", // mmsc
- "", // mmsproxy
- "", // mmsport
- "", // user
- "", // password
- -1, // authtype
- "rcs", // types
- "IPV4V6", // protocol
- "IPV4V6", // roaming_protocol
- 1, // carrier_enabled
- 0, // profile_id
- 1, // modem_cognitive
- 0, // max_conns
- 0, // wait_time
- 0, // max_conns_time
- 0, // mtu
- 1280, // mtu_v4
- 1280, // mtu_v6
- "", // mvno_type
- "", // mnvo_match_data
- TelephonyManager.NETWORK_TYPE_BITMASK_LTE
- | TelephonyManager.NETWORK_TYPE_BITMASK_NR, // network_type_bitmask
- 0, // lingering_network_type_bitmask
- DEFAULT_APN_SET_ID, // apn_set_id
- -1, // carrier_id
- -1, // skip_464xlat
- 0, // always_on
- 2, // INFRASTRUCTURE_SATELLITE
- 1 // esim_bootstrap_provisioning
+ 2 // INFRASTRUCTURE_SATELLITE
}
);
@@ -879,7 +716,7 @@
.build();
TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(request, mPhone);
DataProfile dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dp.canSatisfy(tnr.getCapabilities())).isTrue();
assertThat(dp.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN);
@@ -890,7 +727,7 @@
.build();
tnr = new TelephonyNetworkRequest(request, mPhone);
dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dp.canSatisfy(tnr.getCapabilities())).isTrue();
assertThat(dp.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN);
@@ -900,7 +737,7 @@
.build();
tnr = new TelephonyNetworkRequest(request, mPhone);
dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dp.canSatisfy(tnr.getCapabilities())).isTrue();
assertThat(dp.getApnSetting().getApnName()).isEqualTo(IMS_APN);
@@ -909,7 +746,7 @@
.build();
tnr = new TelephonyNetworkRequest(request, mPhone);
dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dp).isNull();
doReturn(new NetworkRegistrationInfo.Builder()
@@ -922,7 +759,7 @@
.build();
tnr = new TelephonyNetworkRequest(request, mPhone);
dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_NR, false, false , false);
+ TelephonyManager.NETWORK_TYPE_NR, false, false);
assertThat(dp.canSatisfy(tnr.getCapabilities())).isTrue();
assertThat(dp.getApnSetting().getApnName()).isEqualTo(TETHERING_APN);
}
@@ -934,7 +771,7 @@
.build();
TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(request, mPhone);
DataProfile dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_GSM, false, false, false);
+ TelephonyManager.NETWORK_TYPE_GSM, false, false);
// Should not find data profile due to RAT incompatible.
assertThat(dp).isNull();
}
@@ -946,14 +783,14 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN);
logd("Set setLastSetupTimestamp on " + dataProfile);
dataProfile.setLastSetupTimestamp(SystemClock.elapsedRealtime());
// See if another one can be returned.
dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN1);
}
@@ -964,7 +801,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_ENTERPRISE)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting()).isNull();
OsAppId osAppId = new OsAppId(dataProfile.getTrafficDescriptor().getOsAppId());
@@ -977,7 +814,7 @@
.addEnterpriseId(2), ConnectivityManager.TYPE_NONE,
0, NetworkRequest.Type.REQUEST), mPhone);
dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting()).isNull();
osAppId = new OsAppId(dataProfile.getTrafficDescriptor().getOsAppId());
@@ -993,7 +830,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_PRIORITIZE_LATENCY)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting()).isNull();
OsAppId osAppId = new OsAppId(dataProfile.getTrafficDescriptor().getOsAppId());
@@ -1009,7 +846,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_PRIORITIZE_BANDWIDTH)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting()).isNull();
OsAppId osAppId = new OsAppId(dataProfile.getTrafficDescriptor().getOsAppId());
@@ -1027,7 +864,7 @@
.build();
TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(request, mPhone);
DataProfile dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, true, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, true, false);
assertThat(dp.canSatisfy(tnr.getCapabilities())).isTrue();
assertThat(dp.getApnSetting().getApnName()).isEqualTo(RCS_APN);
@@ -1040,7 +877,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN);
dataProfile.setLastSetupTimestamp(SystemClock.elapsedRealtime());
dataProfile.setPreferred(true);
@@ -1054,14 +891,14 @@
// Test See if the same one can be returned.
dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN);
assertThat(mDataProfileManagerUT.isDataProfilePreferred(dataProfile)).isTrue();
// Test Another default internet network connected due to RAT changed. Verify the preferred
// data profile is updated.
DataProfile legacyRatDataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_CDMA, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_CDMA, false, false);
DataNetwork legacyRatInternetNetwork = Mockito.mock(DataNetwork.class);
doReturn(legacyRatDataProfile).when(legacyRatInternetNetwork).getDataProfile();
doReturn(new DataNetworkController.NetworkRequestList(List.of(tnr)))
@@ -1080,7 +917,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_DUN)
.build(), mPhone);
DataProfile dunDataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- dunTnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ dunTnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
DataNetwork dunInternetNetwork = Mockito.mock(DataNetwork.class);
doReturn(dunDataProfile).when(dunInternetNetwork).getDataProfile();
doReturn(new DataNetworkController.NetworkRequestList(List.of(dunTnr)))
@@ -1179,7 +1016,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile).isNull();
// expect default EIMS when SIM absent
@@ -1188,7 +1025,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_EIMS)
.build(), mPhone);
dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo("sos");
// expect no default IMS when SIM absent
@@ -1197,7 +1034,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_IMS)
.build(), mPhone);
dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile).isEqualTo(null);
// Verify null as initial attached data profile is sent to modem
@@ -1227,7 +1064,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile).isNull();
// expect default EIMS when SIM absent
@@ -1236,7 +1073,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_EIMS)
.build(), mPhone);
dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo("sos");
// expect no default IMS when SIM absent
@@ -1245,7 +1082,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_IMS)
.build(), mPhone);
dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile).isEqualTo(null);
// Verify in legacy mode, null IA should NOT be sent to modem
@@ -1280,7 +1117,7 @@
new TelephonyNetworkRequest(new NetworkRequest.Builder()
.addCapability(NetworkCapabilities.NET_CAPABILITY_IMS)
.build(), mPhone),
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(IMS_APN);
}
@@ -1292,7 +1129,7 @@
TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(request, mPhone);
// This should get the merged data profile after deduping.
DataProfile dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dp.canSatisfy(NetworkCapabilities.NET_CAPABILITY_INTERNET)).isTrue();
}
@@ -1429,7 +1266,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_EIMS)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApn()).isEqualTo("sos");
assertThat(dataProfile.getTrafficDescriptor().getDataNetworkName()).isEqualTo("sos");
@@ -1446,7 +1283,7 @@
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.build(), mPhone);
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN);
dataProfile.setLastSetupTimestamp(SystemClock.elapsedRealtime());
DataNetwork internetNetwork = Mockito.mock(DataNetwork.class);
@@ -1517,7 +1354,7 @@
// The carrier configured data profile should be the preferred APN after APN reset
DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN1);
assertThat(mDataProfileManagerUT.isDataProfilePreferred(dataProfile)).isTrue();
@@ -1530,7 +1367,7 @@
// The carrier configured data profile should be the preferred APN after APN reset
dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ tnr, TelephonyManager.NETWORK_TYPE_LTE, false, false);
assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(GENERAL_PURPOSE_APN1);
assertThat(mDataProfileManagerUT.isDataProfilePreferred(dataProfile)).isTrue();
}
@@ -1811,7 +1648,7 @@
.build();
TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(request, mPhone);
DataProfile dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false);
// Mark the APN as permanent failed.
dp.getApnSetting().setPermanentFailed(true);
@@ -1819,8 +1656,7 @@
// Data profile manager should return a different data profile for setup as the previous
// data profile has been marked as permanent failed.
assertThat(mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false))
- .isNotEqualTo(dp);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false)).isNotEqualTo(dp);
}
@Test
@@ -1835,7 +1671,7 @@
.build();
TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(request, mPhone);
DataProfile dp = mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false);
+ TelephonyManager.NETWORK_TYPE_LTE, false, false);
// Mark the APN as permanent failed.
dp.getApnSetting().setPermanentFailed(true);
@@ -1843,8 +1679,7 @@
// Since preferred APN is already set, and that data profile was marked as permanent failed,
// so this should result in getting nothing.
assertThat(mDataProfileManagerUT.getDataProfileForNetworkRequest(tnr,
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false))
- .isNull();
+ TelephonyManager.NETWORK_TYPE_LTE, false, false)).isNull();
}
private void changeSimStateTo(@TelephonyManager.SimState int simState) {
@@ -1865,98 +1700,6 @@
// Verify the we can get the previously permanent failed data profile again.
assertThat(mDataProfileManagerUT.getDataProfileForNetworkRequest(
new TelephonyNetworkRequest(request, mPhone),
- TelephonyManager.NETWORK_TYPE_LTE, false, false, false))
- .isNotNull();
+ TelephonyManager.NETWORK_TYPE_LTE, false, false)).isNotNull();
}
-
- @Test
- public void testDifferentNetworkRequestProfilesOnEsimBootStrapProvisioning() {
- Mockito.clearInvocations(mDataProfileManagerCallback);
- Mockito.clearInvocations(mMockedWwanDataServiceManager);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
-
- // SIM inserted
- mDataProfileManagerUT.obtainMessage(3 /* EVENT_SIM_REFRESH */).sendToTarget();
- processAllMessages();
-
- // expect default profile for internet network request, when esim bootstrap provisioning
- // flag is enabled at data profile, during esim bootstrap provisioning
- TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder()
- .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
- .build(), mPhone);
- DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, true, false);
- assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(
- "ESIM_BOOTSTRAP_PROVISIONING_APN");
-
- // expect IMS profile for ims network request, when esim bootstrap provisioning flag
- // is enabled at data profile, during esim bootstrap provisioning
- tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder()
- .addCapability(NetworkCapabilities.NET_CAPABILITY_IMS)
- .build(), mPhone);
- dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, true, false);
- assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo("IMS_APN");
-
- // expect no mms profile for mms network request, when esim bootstrap provisioning flag
- // is disabled at data profile, during esim bootstrap provisioning
- tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder()
- .addCapability(NetworkCapabilities.NET_CAPABILITY_MMS)
- .build(), mPhone);
- dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, true, false);
- assertThat(dataProfile).isEqualTo(null);
-
- // expect no rcs profile for rcs network request, when esim bootstrap provisioning flag
- // is disabled at data profile, during esim bootstrap provisioning
- tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder()
- .addCapability(NetworkCapabilities.NET_CAPABILITY_RCS)
- .build(), mPhone);
- dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, true, false);
- assertThat(dataProfile).isEqualTo(null);
- }
-
- @Test
- public void testEsimBootstrapProvisioningEnabled_MultipleProfile() {
- Mockito.clearInvocations(mDataProfileManagerCallback);
- Mockito.clearInvocations(mMockedWwanDataServiceManager);
-
- // SIM inserted
- mDataProfileManagerUT.obtainMessage(3 /* EVENT_SIM_REFRESH */).sendToTarget();
- processAllMessages();
-
- // expect initial default profile entry selected for internet network request, when
- // multiple esim bootstrap provisioning flag is enabled at data profile for same apn
- // type
- TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder()
- .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
- .build(), mPhone);
- DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, false, true, false);
- assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(
- ESIM_BOOTSTRAP_PROVISIONING_APN);
- }
-
- @Test
- public void testInfrastructureProfileOnEsimBootStrapProvisioning() {
- Mockito.clearInvocations(mDataProfileManagerCallback);
- Mockito.clearInvocations(mMockedWwanDataServiceManager);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
-
- // SIM inserted
- mDataProfileManagerUT.obtainMessage(3 /* EVENT_SIM_REFRESH */).sendToTarget();
- processAllMessages();
-
- // expect initial default profile entry selected for internet network request, when
- // multiple esim bootstrap provisioning flag is enabled at data profile for same apn
- // type
- TelephonyNetworkRequest tnr = new TelephonyNetworkRequest(new NetworkRequest.Builder()
- .addCapability(NetworkCapabilities.NET_CAPABILITY_RCS)
- .build(), mPhone);
- DataProfile dataProfile = mDataProfileManagerUT.getDataProfileForNetworkRequest(
- tnr, TelephonyManager.NETWORK_TYPE_LTE, true, true, false);
- assertThat(dataProfile.getApnSetting().getApnName()).isEqualTo(RCS_APN1);
- }
-
}