Remove provisioned check before eSIM provision
Before, we will check whether DEVICE_PROVISIONED before we start eSIM
setup flow. However, since we want to add eSIM setup flow into deferred
flow of Setup Wizard in which the DEVICE_PROVISIONED is true. We should
remove this checking before eSIM setup.
Bug: 62420605
Test: Changed
Change-Id: I7d8d603928631b22c313f9cf5e3c8faa7ca7ced7
diff --git a/src/com/android/phone/euicc/EuiccUiDispatcherActivity.java b/src/com/android/phone/euicc/EuiccUiDispatcherActivity.java
index 67234dd..19ef9f7 100644
--- a/src/com/android/phone/euicc/EuiccUiDispatcherActivity.java
+++ b/src/com/android/phone/euicc/EuiccUiDispatcherActivity.java
@@ -21,7 +21,6 @@
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
-import android.provider.Settings;
import android.service.euicc.EuiccService;
import android.telephony.euicc.EuiccManager;
import android.util.Log;
@@ -95,10 +94,6 @@
intent.setAction(EuiccService.ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS);
break;
case EuiccManager.ACTION_PROVISION_EMBEDDED_SUBSCRIPTION:
- if (isDeviceProvisioned()) {
- Log.w(TAG, "Cannot perform eUICC provisioning once device is provisioned");
- return null;
- }
intent.setAction(EuiccService.ACTION_PROVISION_EMBEDDED_SUBSCRIPTION);
intent.putExtra(
EuiccManager.EXTRA_FORCE_PROVISION,
@@ -113,12 +108,6 @@
}
@VisibleForTesting
- boolean isDeviceProvisioned() {
- return Settings.Global.getInt(getContentResolver(),
- Settings.Global.DEVICE_PROVISIONED, 0) != 0;
- }
-
- @VisibleForTesting
@Nullable
ActivityInfo findBestActivity(Intent euiccUiIntent) {
return EuiccConnector.findBestActivity(getPackageManager(), euiccUiIntent);
diff --git a/tests/src/com/android/phone/euicc/EuiccUiDispatcherActivityTest.java b/tests/src/com/android/phone/euicc/EuiccUiDispatcherActivityTest.java
index 722e1bd..901ad9e 100644
--- a/tests/src/com/android/phone/euicc/EuiccUiDispatcherActivityTest.java
+++ b/tests/src/com/android/phone/euicc/EuiccUiDispatcherActivityTest.java
@@ -47,7 +47,6 @@
@Mock private Context mMockContext;
@Mock private EuiccManager mMockEuiccManager;
- private boolean mIsProvisioned = true;
private ActivityInfo mActivityInfo = ACTIVITY_INFO;
private Intent mIntent = MANAGE_INTENT;
private EuiccUiDispatcherActivity mActivity;
@@ -80,12 +79,6 @@
}
@Test
- public void testResolveEuiccUiIntent_alreadyProvisioned() {
- mIntent = PROVISION_INTENT;
- assertNull(mActivity.resolveEuiccUiIntent());
- }
-
- @Test
public void testResolveEuiccUiIntent_noImplementation() {
mActivityInfo = null;
assertNull(mActivity.resolveEuiccUiIntent());
@@ -98,7 +91,6 @@
@Test
public void testResolveEuiccUiIntent_validProvision() {
- mIsProvisioned = false;
assertNotNull(mActivity.resolveEuiccUiIntent());
}
@@ -113,11 +105,6 @@
}
@Override
- boolean isDeviceProvisioned() {
- return mIsProvisioned;
- }
-
- @Override
ActivityInfo findBestActivity(Intent euiccUiIntent) {
return mActivityInfo;
}