Added in API level 28

EuiccManager


open class EuiccManager
kotlin.Any
   ↳ android.telephony.euicc.EuiccManager

EuiccManager is the application interface to eUICCs, or eSIMs/embedded SIMs.

You do not instantiate this class directly; instead, you retrieve an instance through Context.getSystemService(String) and Context.EUICC_SERVICE. This instance will be created using the default eUICC.

On a device with multiple eUICCs, you may want to create multiple EuiccManagers. To do this you can call createForCardId.

See isEnabled before attempting to use these APIs.
Requires the PackageManager#FEATURE_TELEPHONY_EUICC feature which can be detected using PackageManager.hasSystemFeature(String).

Summary

Constants
static String

Intent action to launch the embedded SIM (eUICC) management settings screen.

static String

Broadcast Action: The action sent to carrier app so it knows the carrier setup is not completed.

static String

Intent action sent by a carrier app to launch the eSIM activation flow provided by the LPA UI (LUI).

static Int

Result code for an operation indicating that an unresolvable error occurred.

static Int

Result code for an operation indicating that the operation succeeded.

static Int

Result code for an operation indicating that the user must take some action before the operation can continue.

static Int

Address is missing e.

static Int

Operation such as downloading/switching to another profile failed due to device being carrier locked.

static Int

Certificate needed for authentication is not valid or missing.

static Int

Failure to create a connection.

static Int

Failed to load profile onto eUICC due to Profile Policy Rules.

static Int

There is no more space available on the eUICC for new profiles.

static Int

eUICC is missing or defective on the device.

static Int

The profile's carrier is incompatible with the LPA.

static Int

Failure to load the profile onto the eUICC card.

static Int

The activation code(SGP.22 v2.2 section[4.1]) is invalid.

static Int

The confirmation code(SGP.22 v2.2 section[4.7]) is invalid.

static Int

Failure due to target port is not supported.

static Int

Response format is invalid.

static Int

No profiles available.

static Int

The operation is currently busy, try again later.

static Int

No SIM card is available in the device.

static Int

Timed out while waiting for an operation to complete.

static Int

The eUICC card(hardware) version is incompatible with the software

static Long

Temporary failure to retrieve available memory because eUICC is not ready.

static String

Key for an extra set on PendingIntent result callbacks providing a detailed result code.

static String

Key for an extra set on getDownloadableSubscriptionMetadata PendingIntent result callbacks providing the downloadable subscription metadata.

static String

Key for an extra set on PendingIntent result callbacks providing a ErrorCode of EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE, value will be an int.

static String

Key for an extra set on PendingIntent result callbacks providing a OperationCode of EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE, value will be an int.

static String

Key for an extra set on PendingIntent result callbacks providing a ReasonCode[5.

static String

Key for an extra set on PendingIntent result callbacks providing a SubjectCode[5.

static String

Key for an extra set on actions ACTION_START_EUICC_ACTIVATION providing a boolean value of whether to start eSIM activation with QR scanner.

static String

Optional meta-data attribute for a carrier app providing an icon to use to represent the carrier.

static Int

The exception of failing to execute an APDU command.

static Int

Download profile error.

static Int

eUICC card error.

static Int

eUICC returned an error defined in GSMA (SGP.22 v2.2) while running one of the ES10x functions.

static Int

HTTP error

static Int

Subscription's metadata error

static Int

SIM slot error.

static Int

SMDX(SMDP/SMDS) error

static Int

SubjectCode[5.

static Int

Generic switching profile error

static Int

Internal system error.

Public methods
open EuiccManager

Create a new EuiccManager object pinned to the given card ID.

open Unit
deleteSubscription(subscriptionId: Int, callbackIntent: PendingIntent!)

Deletes the given subscription.

open Unit
downloadSubscription(subscription: DownloadableSubscription!, switchAfterDownload: Boolean, callbackIntent: PendingIntent!)

Attempt to download the given DownloadableSubscription.

open Long

Returns the available memory in bytes of the eUICC.

open String?

Returns the EID identifying the eUICC hardware.

open EuiccInfo?

Returns information about the eUICC chip/device.

open Boolean

Whether embedded subscriptions are currently enabled.

open Boolean
isSimPortAvailable(portIndex: Int)

Returns whether the passing portIndex is available.

open Unit
startResolutionActivity(activity: Activity!, requestCode: Int, resultIntent: Intent!, callbackIntent: PendingIntent!)

Start an activity to resolve a user-resolvable error.

open Unit
switchToSubscription(subscriptionId: Int, callbackIntent: PendingIntent!)

Switch to (enable) the given subscription.

open Unit
switchToSubscription(subscriptionId: Int, portIndex: Int, callbackIntent: PendingIntent)

Switch to (enable) the given subscription.

open Unit
updateSubscriptionNickname(subscriptionId: Int, nickname: String?, callbackIntent: PendingIntent)

Update the nickname for the given subscription.

Constants

ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS

Added in API level 28
static val ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS: String

Intent action to launch the embedded SIM (eUICC) management settings screen.

This screen shows a list of embedded profiles and offers the user the ability to switch between them, download new profiles, and delete unused profiles.

The activity will immediately finish with android.app.Activity#RESULT_CANCELED if isEnabled is false. This is ued by non-LPA app to bring up LUI.

Value: "android.telephony.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS"

ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE

Added in API level 28
static val ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE: String

Broadcast Action: The action sent to carrier app so it knows the carrier setup is not completed.

Value: "android.telephony.euicc.action.NOTIFY_CARRIER_SETUP_INCOMPLETE"

ACTION_START_EUICC_ACTIVATION

Added in API level 30
static val ACTION_START_EUICC_ACTIVATION: String

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:

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 android.service.euicc.EuiccService#ACTION_BIND_CARRIER_PROVISIONING_SERVICE.

EXTRA_USE_QR_SCANNER set to true: The LPA should launch a QR scanner for the user to scan an eSIM profile QR code.

Upon completion, the LPA should return one of the following results to the carrier app:

Activity.RESULT_OK: The LPA has succeeded in downloading the new eSIM profile.

Activity.RESULT_CANCELED: The carrier app should treat this as if the user pressed the back button.

Anything else: The carrier app should treat this as an error.

LPA needs to check if caller's package name is allowed to perform this action.

Value: "android.telephony.euicc.action.START_EUICC_ACTIVATION"

EMBEDDED_SUBSCRIPTION_RESULT_ERROR

Added in API level 28
static val EMBEDDED_SUBSCRIPTION_RESULT_ERROR: Int

Result code for an operation indicating that an unresolvable error occurred. EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE will be populated with a detailed error code for logging/debugging purposes only.

Value: 2

EMBEDDED_SUBSCRIPTION_RESULT_OK

Added in API level 28
static val EMBEDDED_SUBSCRIPTION_RESULT_OK: Int

Result code for an operation indicating that the operation succeeded.

Value: 0

EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR

Added in API level 28
static val EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR: Int

Result code for an operation indicating that the user must take some action before the operation can continue.

Value: 1

ERROR_ADDRESS_MISSING

Added in API level 30
static val ERROR_ADDRESS_MISSING: Int

Address is missing e.g SMDS/SMDP address is missing.

Value: 10011

ERROR_CARRIER_LOCKED

Added in API level 30
static val ERROR_CARRIER_LOCKED: Int

Operation such as downloading/switching to another profile failed due to device being carrier locked.

Value: 10000

ERROR_CERTIFICATE_ERROR

Added in API level 30
static val ERROR_CERTIFICATE_ERROR: Int

Certificate needed for authentication is not valid or missing. E.g SMDP/SMDS authentication failed.

Value: 10012

ERROR_CONNECTION_ERROR

Added in API level 30
static val ERROR_CONNECTION_ERROR: Int

Failure to create a connection.

Value: 10014

ERROR_DISALLOWED_BY_PPR

Added in API level 30
static val ERROR_DISALLOWED_BY_PPR: Int

Failed to load profile onto eUICC due to Profile Policy Rules.

Value: 10010

ERROR_EUICC_INSUFFICIENT_MEMORY

Added in API level 30
static val ERROR_EUICC_INSUFFICIENT_MEMORY: Int

There is no more space available on the eUICC for new profiles.

Value: 10004

ERROR_EUICC_MISSING

Added in API level 30
static val ERROR_EUICC_MISSING: Int

eUICC is missing or defective on the device.

Value: 10006

ERROR_INCOMPATIBLE_CARRIER

Added in API level 30
static val ERROR_INCOMPATIBLE_CARRIER: Int

The profile's carrier is incompatible with the LPA.

Value: 10003

ERROR_INSTALL_PROFILE

Added in API level 30
static val ERROR_INSTALL_PROFILE: Int

Failure to load the profile onto the eUICC card. e.g 1. iccid of the profile already exists on the eUICC. 2. GSMA(.22 v2.2) Profile Install Result - installFailedDueToDataMismatch 3. operation was interrupted 4. SIMalliance error in PEStatus(SGP.22 v2.2 section 2.5.6.1)

Value: 10009

ERROR_INVALID_ACTIVATION_CODE

Added in API level 30
static val ERROR_INVALID_ACTIVATION_CODE: Int

The activation code(SGP.22 v2.2 section[4.1]) is invalid.

Value: 10001

ERROR_INVALID_CONFIRMATION_CODE

Added in API level 30
static val ERROR_INVALID_CONFIRMATION_CODE: Int

The confirmation code(SGP.22 v2.2 section[4.7]) is invalid.

Value: 10002

ERROR_INVALID_PORT

Added in API level 33
static val ERROR_INVALID_PORT: Int

Failure due to target port is not supported.

Value: 10017

ERROR_INVALID_RESPONSE

Added in API level 30
static val ERROR_INVALID_RESPONSE: Int

Response format is invalid. e.g SMDP/SMDS response contains invalid json, header or/and ASN1.

Value: 10015

ERROR_NO_PROFILES_AVAILABLE

Added in API level 30
static val ERROR_NO_PROFILES_AVAILABLE: Int

No profiles available.

Value: 10013

ERROR_OPERATION_BUSY

Added in API level 30
static val ERROR_OPERATION_BUSY: Int

The operation is currently busy, try again later.

Value: 10016

ERROR_SIM_MISSING

Added in API level 30
static val ERROR_SIM_MISSING: Int

No SIM card is available in the device.

Value: 10008

ERROR_TIME_OUT

Added in API level 30
static val ERROR_TIME_OUT: Int

Timed out while waiting for an operation to complete. i.e restart, disable, switch reset etc.

Value: 10005

ERROR_UNSUPPORTED_VERSION

Added in API level 30
static val ERROR_UNSUPPORTED_VERSION: Int

The eUICC card(hardware) version is incompatible with the software

Value: 10007

EUICC_MEMORY_FIELD_UNAVAILABLE

Added in API level 35
static val EUICC_MEMORY_FIELD_UNAVAILABLE: Long

Temporary failure to retrieve available memory because eUICC is not ready.

Value: -1L