diff options
| author | 2019-10-18 11:00:11 -0700 | |
|---|---|---|
| committer | 2019-11-13 19:44:11 -0800 | |
| commit | 216ae8d08e90bceb81f686351a4bf73c2c503fac (patch) | |
| tree | ac623d486ca03d96b4da6e7d9b2c6475da1b8d77 | |
| parent | 6e5fd21a65e1dad52ebb1141b6dac9ae6baee996 (diff) | |
Add public APIs for carrier apps
Add public APIs to for carrier apps to trigger activation flow and vice
versa without carrier privilege.
Bug: 139446545
Test: Manually tested
Change-Id: I26d4d9d435dbfbf1e87bef962c6bced057784e0a
Merged-In: I26d4d9d435dbfbf1e87bef962c6bced057784e0a
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | api/system-current.txt | 3 | ||||
| -rw-r--r-- | core/java/android/service/euicc/EuiccService.java | 30 | ||||
| -rw-r--r-- | telephony/java/android/telephony/euicc/EuiccManager.java | 35 |
4 files changed, 69 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index 98f35ee96eec..34bb19fc5567 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45495,11 +45495,13 @@ package android.telephony.euicc { method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void updateSubscriptionNickname(int, @Nullable String, @NonNull android.app.PendingIntent); field public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.telephony.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS"; field public static final String ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE = "android.telephony.euicc.action.NOTIFY_CARRIER_SETUP_INCOMPLETE"; + field public static final String ACTION_START_EUICC_ACTIVATION = "android.telephony.euicc.action.START_EUICC_ACTIVATION"; field public static final int EMBEDDED_SUBSCRIPTION_RESULT_ERROR = 2; // 0x2 field public static final int EMBEDDED_SUBSCRIPTION_RESULT_OK = 0; // 0x0 field public static final int EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR = 1; // 0x1 field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE"; field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION"; + field public static final String EXTRA_USE_QR_SCANNER = "android.telephony.euicc.extra.USE_QR_SCANNER"; field public static final String META_DATA_CARRIER_ICON = "android.telephony.euicc.carriericon"; } diff --git a/api/system-current.txt b/api/system-current.txt index 7a930261a810..03465a11777e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6576,6 +6576,8 @@ package android.service.euicc { field public static final String ACTION_RESOLVE_DEACTIVATE_SIM = "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM"; field public static final String ACTION_RESOLVE_NO_PRIVILEGES = "android.service.euicc.action.RESOLVE_NO_PRIVILEGES"; field public static final String ACTION_RESOLVE_RESOLVABLE_ERRORS = "android.service.euicc.action.RESOLVE_RESOLVABLE_ERRORS"; + field public static final String ACTION_START_CARRIER_ACTIVATION = "android.service.euicc.action.START_CARRIER_ACTIVATION"; + field public static final String ACTION_START_EUICC_ACTIVATION = "android.service.euicc.action.START_EUICC_ACTIVATION"; field public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED"; field public static final String CATEGORY_EUICC_UI = "android.service.euicc.category.EUICC_UI"; field public static final String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService"; @@ -8627,6 +8629,7 @@ package android.telephony.euicc { field public static final String EXTRA_ENABLE_SUBSCRIPTION = "android.telephony.euicc.extra.ENABLE_SUBSCRIPTION"; field public static final String EXTRA_FORCE_PROVISION = "android.telephony.euicc.extra.FORCE_PROVISION"; field public static final String EXTRA_FROM_SUBSCRIPTION_ID = "android.telephony.euicc.extra.FROM_SUBSCRIPTION_ID"; + field public static final String EXTRA_PHYSICAL_SLOT_ID = "android.telephony.euicc.extra.PHYSICAL_SLOT_ID"; field public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.euicc.extra.SUBSCRIPTION_ID"; field public static final String EXTRA_SUBSCRIPTION_NICKNAME = "android.telephony.euicc.extra.SUBSCRIPTION_NICKNAME"; } diff --git a/core/java/android/service/euicc/EuiccService.java b/core/java/android/service/euicc/EuiccService.java index 12c25806d666..2d40ec480379 100644 --- a/core/java/android/service/euicc/EuiccService.java +++ b/core/java/android/service/euicc/EuiccService.java @@ -21,6 +21,7 @@ import android.annotation.CallSuper; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.SdkConstant; import android.annotation.SystemApi; import android.app.Service; import android.content.Intent; @@ -104,6 +105,26 @@ public abstract class EuiccService extends Service { "android.service.euicc.action.BIND_CARRIER_PROVISIONING_SERVICE"; /** + * Intent action sent by the LPA to launch a carrier app Activity for eSIM activation, e.g. a + * carrier login screen. Carrier apps wishing to support this activation method must implement + * an Activity that responds to this intent action. Upon completion, the Activity must return + * one of the following results to the LPA: + * + * <p>{@code Activity.RESULT_CANCELED}: The LPA should treat this as an back button and abort + * the activation flow. + * <p>{@code Activity.RESULT_OK}: The LPA should try to get an activation code from the carrier + * app by binding to the carrier app service implementing + * {@link #ACTION_BIND_CARRIER_PROVISIONING_SERVICE}. + * <p>{@code Activity.RESULT_OK} with + * {@link android.telephony.euicc.EuiccManager#EXTRA_USE_QR_SCANNER} set to true: The LPA should + * start a QR scanner for the user to scan an eSIM profile QR code. + * <p>For other results: The LPA should treat this as an error. + **/ + @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_START_CARRIER_ACTIVATION = + "android.service.euicc.action.START_CARRIER_ACTIVATION"; + + /** * @see android.telephony.euicc.EuiccManager#ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS * The difference is this one is used by system to bring up the LUI. */ @@ -138,6 +159,15 @@ public abstract class EuiccService extends Service { public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED"; + /** + * @see android.telephony.euicc.EuiccManager#ACTION_START_EUICC_ACTIVATION. This is + * a protected intent that can only be sent by the system, and requires the + * {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission. + */ + @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_START_EUICC_ACTIVATION = + "android.service.euicc.action.START_EUICC_ACTIVATION"; + // LUI resolution actions. These are called by the platform to resolve errors in situations that // require user interaction. // TODO(b/33075886): Define extras for any input parameters to these dialogs once they are diff --git a/telephony/java/android/telephony/euicc/EuiccManager.java b/telephony/java/android/telephony/euicc/EuiccManager.java index 0025c7acb18c..2f90a3dce724 100644 --- a/telephony/java/android/telephony/euicc/EuiccManager.java +++ b/telephony/java/android/telephony/euicc/EuiccManager.java @@ -189,6 +189,29 @@ public class EuiccManager { "android.telephony.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED"; /** + * Intent action sent by a carrier app to launch the eSIM activation flow provided by the LPA UI + * (LUI). The carrier app must send this intent with one of the following: + * + * <p>{@link #EXTRA_USE_QR_SCANNER} not set or set to false: The LPA should try to get an + * activation code from the carrier app by binding to the carrier app service implementing + * {@link android.service.euicc.EuiccService#ACTION_BIND_CARRIER_PROVISIONING_SERVICE}. + * <p>{@link #EXTRA_USE_QR_SCANNER} set to true: The LPA should launch a QR scanner for the user + * to scan an eSIM profile QR code. + * + * <p>Upon completion, the LPA should return one of the following results to the carrier app: + * + * <p>{@code Activity.RESULT_OK}: The LPA has succeeded in downloading the new eSIM profile. + * <p>{@code Activity.RESULT_CANCELED}: The carrier app should treat this as if the user pressed + * the back button. + * <p>Anything else: The carrier app should treat this as an error. + * + * <p>LPA needs to check if caller's package name is allowed to perform this action. + **/ + @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_START_EUICC_ACTIVATION = + "android.telephony.euicc.action.START_EUICC_ACTIVATION"; + + /** * Result code for an operation indicating that the operation succeeded. */ public static final int EMBEDDED_SUBSCRIPTION_RESULT_OK = 0; @@ -342,10 +365,20 @@ public class EuiccManager { * * @hide */ - // TODO: Make this a @SystemApi. + @SystemApi public static final String EXTRA_PHYSICAL_SLOT_ID = "android.telephony.euicc.extra.PHYSICAL_SLOT_ID"; + + /** + * Key for an extra set on actions {@link #ACTION_START_EUICC_ACTIVATION} providing a boolean + * value of whether to start eSIM activation with QR scanner. + * + * <p>Expected type of the extra data: boolean + **/ + public static final String EXTRA_USE_QR_SCANNER = + "android.telephony.euicc.extra.USE_QR_SCANNER"; + /** * Optional meta-data attribute for a carrier app providing an icon to use to represent the * carrier. If not provided, the app's launcher icon will be used as a fallback. |