Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/telephony/euicc/EuiccManager#constants) \| [Methods](https://developer.android.com/reference/android/telephony/euicc/EuiccManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/telephony/euicc/EuiccManager#inhmethods)

# EuiccManager

*** ** * ** ***

` public class EuiccManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telephony.euicc.EuiccManager |

<br />

*** ** * ** ***

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

You do not instantiate this class directly; instead, you retrieve an instance through `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` and `https://developer.android.com/reference/android/content/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 `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#createForCardId(int)`.

See `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#isEnabled()` before attempting to use these APIs.   

Requires the `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC` feature which can be detected using `https://developer.android.com/reference/android/content/pm/PackageManager#hasSystemFeature(java.lang.String)`.

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS` Intent action to launch the embedded SIM (eUICC) management settings screen. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE` Broadcast Action: The action sent to carrier app so it knows the carrier setup is not completed. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ACTION_START_EUICC_ACTIVATION` Intent action sent by a carrier app to launch the eSIM activation flow provided by the LPA UI (LUI). |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_ERROR` Result code for an operation indicating that an unresolvable error occurred. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_OK` Result code for an operation indicating that the operation succeeded. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR` Result code for an operation indicating that the user must take some action before the operation can continue. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_ADDRESS_MISSING` Address is missing e.g SMDS/SMDP address is missing. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_CARRIER_LOCKED` Operation such as downloading/switching to another profile failed due to device being carrier locked. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_CERTIFICATE_ERROR` Certificate needed for authentication is not valid or missing. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_CONNECTION_ERROR` Failure to create a connection. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_DISALLOWED_BY_PPR` Failed to load profile onto eUICC due to Profile Policy Rules. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_EUICC_INSUFFICIENT_MEMORY` There is no more space available on the eUICC for new profiles. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_EUICC_MISSING` eUICC is missing or defective on the device. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_INCOMPATIBLE_CARRIER` The profile's carrier is incompatible with the LPA. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_INSTALL_PROFILE` Failure to load the profile onto the eUICC card. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_INVALID_ACTIVATION_CODE` The activation code(SGP.22 v2.2 section\[4.1\]) is invalid. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_INVALID_CONFIRMATION_CODE` The confirmation code(SGP.22 v2.2 section\[4.7\]) is invalid. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_INVALID_PORT` Failure due to target port is not supported. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_INVALID_RESPONSE` Response format is invalid. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_NO_PROFILES_AVAILABLE` No profiles available. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_OPERATION_BUSY` The operation is currently busy, try again later. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_SIM_MISSING` No SIM card is available in the device. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_TIME_OUT` Timed out while waiting for an operation to complete. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_UNSUPPORTED_VERSION` The eUICC card(hardware) version is incompatible with the software |
| `long` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EUICC_MEMORY_FIELD_UNAVAILABLE` Temporary failure to retrieve available memory because eUICC is not ready. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE` Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a detailed result code. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION` Key for an extra set on `#getDownloadableSubscriptionMetadata` PendingIntent result callbacks providing the downloadable subscription metadata. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_ERROR_CODE` Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a ErrorCode of `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`, value will be an int. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_OPERATION_CODE` Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a OperationCode of `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`, value will be an int. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE` Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a ReasonCode\[5.2.6.2\] from GSMA (SGP.22 v2.2) decoded from `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_SUBJECT_CODE` Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a SubjectCode\[5.2.6.1\] from GSMA (SGP.22 v2.2) decoded from `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_USE_QR_SCANNER` Key for an extra set on actions `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ACTION_START_EUICC_ACTIVATION` providing a boolean value of whether to start eSIM activation with QR scanner. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#META_DATA_CARRIER_ICON` Optional meta-data attribute for a carrier app providing an icon to use to represent the carrier. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_APDU` The exception of failing to execute an APDU command. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_DOWNLOAD` Download profile error. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_EUICC_CARD` eUICC card error. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_EUICC_GSMA` eUICC returned an error defined in GSMA (SGP.22 v2.2) while running one of the ES10x functions. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_HTTP` HTTP error |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_METADATA` Subscription's metadata error |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_SIM_SLOT` SIM slot error. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_SMDX` SMDX(SMDP/SMDS) error |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE` SubjectCode\[5.2.6.1\] and ReasonCode\[5.2.6.2\] error from GSMA (SGP.22 v2.2) When `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE` is used as the `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`, the remaining three bytes of the integer result from `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE` will be used to stored the SubjectCode and ReasonCode from the GSMA spec and NOT ErrorCode. |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_SWITCH` Generic switching profile error |
| `int` | `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_SYSTEM` Internal system error. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#createForCardId(int)(int cardId) ` Create a new EuiccManager object pinned to the given card ID. |
| ` void` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#deleteSubscription(int,%20android.app.PendingIntent)(int subscriptionId, https://developer.android.com/reference/android/app/PendingIntent callbackIntent) ` Deletes the given subscription. |
| ` void` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#downloadSubscription(android.telephony.euicc.DownloadableSubscription,%20boolean,%20android.app.PendingIntent)(https://developer.android.com/reference/android/telephony/euicc/DownloadableSubscription subscription, boolean switchAfterDownload, https://developer.android.com/reference/android/app/PendingIntent callbackIntent) ` Attempt to download the given `https://developer.android.com/reference/android/telephony/euicc/DownloadableSubscription`. |
| ` long` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#getAvailableMemoryInBytes()() ` Returns the available memory in bytes of the eUICC. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#getEid()() ` Returns the EID identifying the eUICC hardware. |
| ` https://developer.android.com/reference/android/telephony/euicc/EuiccInfo` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#getEuiccInfo()() ` Returns information about the eUICC chip/device. |
| ` boolean` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#isEnabled()() ` Whether embedded subscriptions are currently enabled. |
| ` boolean` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#isSimPortAvailable(int)(int portIndex) ` Returns whether the passing portIndex is available. |
| ` void` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#startResolutionActivity(android.app.Activity,%20int,%20android.content.Intent,%20android.app.PendingIntent)(https://developer.android.com/reference/android/app/Activity activity, int requestCode, https://developer.android.com/reference/android/content/Intent resultIntent, https://developer.android.com/reference/android/app/PendingIntent callbackIntent) ` Start an activity to resolve a user-resolvable error. |
| ` void` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#switchToSubscription(int,%20android.app.PendingIntent)(int subscriptionId, https://developer.android.com/reference/android/app/PendingIntent callbackIntent) ` Switch to (enable) the given subscription. |
| ` void` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#switchToSubscription(int,%20int,%20android.app.PendingIntent)(int subscriptionId, int portIndex, https://developer.android.com/reference/android/app/PendingIntent callbackIntent) ` Switch to (enable) the given subscription. |
| ` void` | ` https://developer.android.com/reference/android/telephony/euicc/EuiccManager#updateSubscriptionNickname(int,%20java.lang.String,%20android.app.PendingIntent)(int subscriptionId, https://developer.android.com/reference/java/lang/String nickname, https://developer.android.com/reference/android/app/PendingIntent callbackIntent) ` Update the nickname for the given subscription. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS
```

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 `https://developer.android.com/reference/android/app/Activity#RESULT_CANCELED` if `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#isEnabled()` is false. This is ued by non-LPA app to bring up LUI.

<br />

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

### ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE
```

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

<br />

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

### ACTION_START_EUICC_ACTIVATION

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_START_EUICC_ACTIVATION
```

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:

`https://developer.android.com/reference/android/telephony/euicc/EuiccManager#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`.

`https://developer.android.com/reference/android/telephony/euicc/EuiccManager#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.

<br />

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

### EMBEDDED_SUBSCRIPTION_RESULT_ERROR

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EMBEDDED_SUBSCRIPTION_RESULT_ERROR
```

Result code for an operation indicating that an unresolvable error occurred. `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE` will be populated with a detailed error code for logging/debugging purposes only.

<br />

Constant Value: 2 (0x00000002)

### EMBEDDED_SUBSCRIPTION_RESULT_OK

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EMBEDDED_SUBSCRIPTION_RESULT_OK
```

Result code for an operation indicating that the operation succeeded.

<br />

Constant Value: 0 (0x00000000)

### EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#startResolutionActivity(android.app.Activity,%20int,%20android.content.Intent,%20android.app.PendingIntent)`

Constant Value: 1 (0x00000001)

### ERROR_ADDRESS_MISSING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_ADDRESS_MISSING
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10011 (0x0000271b)

### ERROR_CARRIER_LOCKED

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_CARRIER_LOCKED
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10000 (0x00002710)

### ERROR_CERTIFICATE_ERROR

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_CERTIFICATE_ERROR
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10012 (0x0000271c)

### ERROR_CONNECTION_ERROR

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_CONNECTION_ERROR
```

Failure to create a connection.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10014 (0x0000271e)

### ERROR_DISALLOWED_BY_PPR

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_DISALLOWED_BY_PPR
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10010 (0x0000271a)

### ERROR_EUICC_INSUFFICIENT_MEMORY

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_EUICC_INSUFFICIENT_MEMORY
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10004 (0x00002714)

### ERROR_EUICC_MISSING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_EUICC_MISSING
```

eUICC is missing or defective on the device.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10006 (0x00002716)

### ERROR_INCOMPATIBLE_CARRIER

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INCOMPATIBLE_CARRIER
```

The profile's carrier is incompatible with the LPA.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10003 (0x00002713)

### ERROR_INSTALL_PROFILE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INSTALL_PROFILE
```

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)

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10009 (0x00002719)

### ERROR_INVALID_ACTIVATION_CODE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INVALID_ACTIVATION_CODE
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10001 (0x00002711)

### ERROR_INVALID_CONFIRMATION_CODE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INVALID_CONFIRMATION_CODE
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10002 (0x00002712)

### ERROR_INVALID_PORT

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INVALID_PORT
```

Failure due to target port is not supported.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#switchToSubscription(int,%20int,%20android.app.PendingIntent)`

Constant Value: 10017 (0x00002721)

### ERROR_INVALID_RESPONSE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INVALID_RESPONSE
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10015 (0x0000271f)

### ERROR_NO_PROFILES_AVAILABLE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_NO_PROFILES_AVAILABLE
```

No profiles available.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10013 (0x0000271d)

### ERROR_OPERATION_BUSY

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_OPERATION_BUSY
```

The operation is currently busy, try again later.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10016 (0x00002720)

### ERROR_SIM_MISSING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_SIM_MISSING
```

No SIM card is available in the device.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10008 (0x00002718)

### ERROR_TIME_OUT

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_TIME_OUT
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10005 (0x00002715)

### ERROR_UNSUPPORTED_VERSION

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_UNSUPPORTED_VERSION
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10007 (0x00002717)

### EUICC_MEMORY_FIELD_UNAVAILABLE

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long EUICC_MEMORY_FIELD_UNAVAILABLE
```

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

<br />

Constant Value: -1 (0xffffffffffffffff)

### EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE
```

Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a detailed result code.

The value of this key is an integer and contains two portions. The first byte is OperationCode and the reaming three bytes is the ErrorCode. OperationCode is the first byte of the result code and is a categorization which defines what type of operation took place when an error occurred. e.g `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_DOWNLOAD` means the error is related to download.Since the OperationCode only uses at most one byte, the maximum allowed quantity is 255(0xFF). ErrorCode is the remaining three bytes of the result code, and it denotes what happened. e.g a combination of `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_DOWNLOAD` and `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_TIME_OUT` will suggest the download operation has timed out. The only exception here is `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE`, where instead of ErrorCode, SubjectCode\[5.2.6.1 from GSMA (SGP.22 v2.2) and ReasonCode\[5.2.6.2\] from GSMA (SGP.22 v2.2) are encoded. @see `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_SUBJECT_CODE` and `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE` In the case where ErrorCode contains a value of 0, it means it's an unknown error. E.g Intent only contains `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_DOWNLOAD` and ErrorCode is 0 implies this is an unknown Download error.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_OPERATION_CODE`
- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_ERROR_CODE`
- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_SUBJECT_CODE`
- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE`

Constant Value: "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE"

### EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION
```

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

<br />

Constant Value: "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION"

### EXTRA_EMBEDDED_SUBSCRIPTION_ERROR_CODE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_ERROR_CODE
```

Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a ErrorCode of `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`, value will be an int.

<br />

Constant Value: "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_ERROR_CODE"

### EXTRA_EMBEDDED_SUBSCRIPTION_OPERATION_CODE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_OPERATION_CODE
```

Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a OperationCode of `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`, value will be an int.

<br />

Constant Value: "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_OPERATION_CODE"

### EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE
```

Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a ReasonCode\[5.2.6.2\] from GSMA (SGP.22 v2.2) decoded from `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`. The value of this extra will be a String.

<br />

Constant Value: "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_SMDX_REASON_CODE"

### EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_SUBJECT_CODE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_SMDX_SUBJECT_CODE
```

Key for an extra set on `https://developer.android.com/reference/android/app/PendingIntent` result callbacks providing a SubjectCode\[5.2.6.1\] from GSMA (SGP.22 v2.2) decoded from `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`. The value of this extra will be a String.

<br />

Constant Value: "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_SMDX_SUBJECT_CODE"

### EXTRA_USE_QR_SCANNER

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_USE_QR_SCANNER
```

Key for an extra set on actions `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ACTION_START_EUICC_ACTIVATION` providing a boolean value of whether to start eSIM activation with QR scanner.

Expected type of the extra data: boolean

<br />

Constant Value: "android.telephony.euicc.extra.USE_QR_SCANNER"

### META_DATA_CARRIER_ICON

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String META_DATA_CARRIER_ICON
```

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.

<br />

Constant Value: "android.telephony.euicc.carriericon"

### OPERATION_APDU

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_APDU
```

The exception of failing to execute an APDU command. It can be caused by an error happening on opening the basic or logical channel, or the response of the APDU command is not success (0x9000).

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 8 (0x00000008)

### OPERATION_DOWNLOAD

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_DOWNLOAD
```

Download profile error.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 5 (0x00000005)

### OPERATION_EUICC_CARD

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_EUICC_CARD
```

eUICC card error.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 3 (0x00000003)

### OPERATION_EUICC_GSMA

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_EUICC_GSMA
```

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

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 7 (0x00000007)

### OPERATION_HTTP

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_HTTP
```

HTTP error

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 11 (0x0000000b)

### OPERATION_METADATA

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_METADATA
```

Subscription's metadata error

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 6 (0x00000006)

### OPERATION_SIM_SLOT

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_SIM_SLOT
```

SIM slot error. Failed to switch slot, failed to access the physical slot etc.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 2 (0x00000002)

### OPERATION_SMDX

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_SMDX
```

SMDX(SMDP/SMDS) error

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 9 (0x00000009)

### OPERATION_SMDX_SUBJECT_REASON_CODE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_SMDX_SUBJECT_REASON_CODE
```

SubjectCode\[5.2.6.1\] and ReasonCode\[5.2.6.2\] error from GSMA (SGP.22 v2.2) When `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#OPERATION_SMDX_SUBJECT_REASON_CODE` is used as the `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`, the remaining three bytes of the integer result from `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE` will be used to stored the SubjectCode and ReasonCode from the GSMA spec and NOT ErrorCode. The encoding will follow the format of: 1. The first byte of the result will be 255(0xFF). 2. Remaining three bytes(24 bits) will be split into six sections, 4 bits in each section. 3. A SubjectCode/ReasonCode will take 12 bits each. 4. The maximum number can be represented per section is 15, as that is the maximum number allowed to be stored into 4 bits 5. Maximum supported nested category from GSMA is three layers. E.g 8.11.1.2 is not supported. E.g given SubjectCode(8.11.1) and ReasonCode(5.1) Base10: 0 10 8 11 1 0 5 1 Base2: 0000 1010 1000 1011 0001 0000 0101 0001 Base16: 0 A 8 B 1 0 5 1 Thus the integer stored in `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE` is 0xA8B1051(176885841)

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 10 (0x0000000a)

### OPERATION_SWITCH

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_SWITCH
```

Generic switching profile error

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 4 (0x00000004)

### OPERATION_SYSTEM

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int OPERATION_SYSTEM
```

Internal system error.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE`

Constant Value: 1 (0x00000001)

## Public methods

### createForCardId

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public EuiccManager createForCardId (int cardId)
```

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

<br />

| Parameters ||
|---|---|
| `cardId` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telephony/euicc/EuiccManager` | an EuiccManager that uses the given card ID for all calls. This value cannot be `null`. <br /> |

### deleteSubscription

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void deleteSubscription (int subscriptionId, 
                PendingIntent callbackIntent)
```

Deletes the given subscription.

If this subscription is currently active, the device will first switch away from it onto an "empty" subscription.

Requires that the calling app has carrier privileges according to the metadata of the profile to be deleted, or the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` permission. Starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM`, if the caller is a device owner, profile owner, or holds the `android.Manifest.permission#MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS` permission, then the caller can delete a subscription that was downloaded by that caller. If such a caller tries to delete any other subscription then the operation will fail with `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_ERROR`.   

Requires android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS or `https://developer.android.com/reference/android/Manifest.permission#MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS`

<br />

| Parameters ||
|---|---|
| `subscriptionId` | `int`: the ID of the subscription to delete. <br /> |
| `callbackIntent` | `PendingIntent`: a PendingIntent to launch when the operation completes. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |

### downloadSubscription

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void downloadSubscription (DownloadableSubscription subscription, 
                boolean switchAfterDownload, 
                PendingIntent callbackIntent)
```

Attempt to download the given `https://developer.android.com/reference/android/telephony/euicc/DownloadableSubscription`.

Requires the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` or the calling app must be authorized to manage both the currently-active subscription on the current eUICC and the subscription to be downloaded according to the subscription metadata. Without the former, an `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR` will be returned in the callback intent to prompt the user to accept the download.

Starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM`, if the caller has the `android.Manifest.permission#MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS` permission or is a profile owner or device owner, then the downloaded subscription will be managed by that caller. In case the caller is device owner or profile owner of an organization-owned device, `switchAfterDownload` can be set to true to automatically enable the subscription after download. If the caller is a profile owner on non organization owned device `switchAfterDownload` should be false otherwise the operation will fail with `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_ERROR`.

On a multi-active SIM device, requires the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` permission, or a calling app only if the targeted eUICC does not currently have an active subscription or the calling app is authorized to manage the active subscription on the target eUICC, and the calling app is authorized to manage any active subscription on any SIM. Without it, an `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR` will be returned in the callback intent to prompt the user to accept the download. The caller should also be authorized to manage the subscription to be downloaded.

If device support `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC_MEP` and switchAfterDownload is `true`, the subscription will be enabled on an esim port based on the following selection rules:

- In SS(Single SIM) mode, if the embedded slot already has an active port, then download and enable the subscription on this port.
- In SS mode, if the embedded slot is not active, then try to download and enable the subscription on the default port 0 of eUICC.
- In DSDS mode, find first available port to download and enable the subscription. (see `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#isSimPortAvailable(int)`)

If there is no available port, an `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR` will be returned in the callback intent to prompt the user to disable an already-active subscription.   
Requires android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS or `https://developer.android.com/reference/android/Manifest.permission#MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS`

<br />

<br />

| Parameters ||
|---|---|
| `subscription` | `DownloadableSubscription`: the subscription to download. <br /> |
| `switchAfterDownload` | `boolean`: if true, the profile will be activated upon successful download. <br /> |
| `callbackIntent` | `PendingIntent`: a PendingIntent to launch when the operation completes. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |

### getAvailableMemoryInBytes

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getAvailableMemoryInBytes ()
```

Returns the available memory in bytes of the eUICC.   

Requires `https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE` or android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE or `https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges()`

<br />

| Returns ||
|---|---|
| `long` | the available memory in bytes. May be `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EUICC_MEMORY_FIELD_UNAVAILABLE` if the eUICC is not ready. Check `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#isEnabled()` for more information. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC` or device doesn't support querying this information from the eUICC. |

### getEid

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getEid ()
```

Returns the EID identifying the eUICC hardware.

Requires that the calling app has carrier privileges on the active subscription on the current eUICC. A calling app with carrier privileges for one eUICC may not necessarily have access to the EID of another eUICC.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the EID. May be null if the eUICC is not ready. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |

### getEuiccInfo

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public EuiccInfo getEuiccInfo ()
```

Returns information about the eUICC chip/device.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telephony/euicc/EuiccInfo` | the `https://developer.android.com/reference/android/telephony/euicc/EuiccInfo`. May be null if the eUICC is not ready. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |

### isEnabled

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEnabled ()
```

Whether embedded subscriptions are currently enabled.

Even on devices with the `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC` feature, embedded subscriptions may be turned off, e.g. because of a carrier restriction from an inserted physical SIM. Therefore, this runtime check should be used before accessing embedded subscription APIs.

<br />

| Returns ||
|---|---|
| `boolean` | true if embedded subscriptions are currently enabled. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |

### isSimPortAvailable

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isSimPortAvailable (int portIndex)
```

Returns whether the passing portIndex is available. A port is available if it is active without enabled profile on it or calling app has carrier privilege over the profile installed on the selected port.

From Android U, a port is available if it is active without an enabled profile on it or calling app can activate a new profile on the selected port without any user interaction. Always returns false if the cardId is a physical card.

<br />

| Parameters ||
|---|---|
| `portIndex` | `int`: is an enumeration of the ports available on the UICC. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if port is available <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |

### startResolutionActivity

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startResolutionActivity (Activity activity, 
                int requestCode, 
                Intent resultIntent, 
                PendingIntent callbackIntent)
```

Start an activity to resolve a user-resolvable error.

If an operation returns `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR`, this method may be called to prompt the user to resolve the issue.

This method may only be called once for a particular error.

<br />

| Parameters ||
|---|---|
| `activity` | `Activity`: the calling activity (which should be in the foreground). <br /> |
| `requestCode` | `int`: an application-specific request code which will be provided to `https://developer.android.com/reference/android/app/Activity#onActivityResult(int,%20int,%20android.content.Intent)` upon completion. Note that the operation may still be in progress when the resolution activity completes; it is not fully finished until the callback intent is triggered. <br /> |
| `resultIntent` | `Intent`: the Intent provided to the initial callback intent which failed with `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR`. <br /> |
| `callbackIntent` | `PendingIntent`: a PendingIntent to launch when the operation completes. This is trigered upon completion of the original operation that required user resolution. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/IntentSender.SendIntentException` | if called more than once. |

### switchToSubscription

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void switchToSubscription (int subscriptionId, 
                PendingIntent callbackIntent)
```

Switch to (enable) the given subscription.

Requires the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` permission, or the calling app must be authorized to manage both the currently-active subscription and the subscription to be enabled according to the subscription metadata. Without the former, an `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR` will be returned in the callback intent to prompt the user to accept the download.

On a multi-active SIM device, requires the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` permission, or a calling app only if the targeted eUICC does not currently have an active subscription or the calling app is authorized to manage the active subscription on the target eUICC, and the calling app is authorized to manage any active subscription on any SIM. Without it, an `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR` will be returned in the callback intent to prompt the user to accept the download. The caller should also be authorized to manage the subscription to be enabled.

From Android T, devices might support `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC_MEP`, the subscription can be installed on different port from the eUICC. Calling apps with carrier privilege (see `https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges()`) over the currently active subscriptions can use `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#switchToSubscription(int,%20int,%20android.app.PendingIntent)` to specify which port to enable the subscription. Otherwise, use this API to enable the subscription on the eUICC and the platform will internally resolve a port based on following rules:

- always use the default port 0 is eUICC does not support MEP or the apps are not targeting on Android T.
- In SS(Single SIM) mode, if the embedded slot already has an active port, then enable the subscription on this port.
- In SS mode, if the embedded slot is not active, then try to enable the subscription on the default port 0 of eUICC.
- In DSDS mode, find first available port to enable the subscription. (see `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#isSimPortAvailable(int)`)

If there is no available port, an `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR` will be returned in the callback intent to prompt the user to disable an already-active subscription.   
Requires android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS

<br />

<br />

| Parameters ||
|---|---|
| `subscriptionId` | `int`: the ID of the subscription to enable. May be `https://developer.android.com/reference/android/telephony/SubscriptionManager#INVALID_SUBSCRIPTION_ID` to deactivate the current profile without activating another profile to replace it. Calling apps targeting on android T must use `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#switchToSubscription(int,%20int,%20android.app.PendingIntent)` API for disable profile, port index can be found from `https://developer.android.com/reference/android/telephony/SubscriptionInfo#getPortIndex()`. If it's a disable operation, requires the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` permission, or the calling app must be authorized to manage the active subscription on the target eUICC. <br /> |
| `callbackIntent` | `PendingIntent`: a PendingIntent to launch when the operation completes. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |

### switchToSubscription

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void switchToSubscription (int subscriptionId, 
                int portIndex, 
                PendingIntent callbackIntent)
```

Switch to (enable) the given subscription.

Requires the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` permission, or the caller must be having both the carrier privileges (see `https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges()`) over any currently active subscriptions and the subscription to be enabled according to the subscription metadata. Without the former permissions, an SecurityException is thrown.

If the caller is passing invalid port index, an `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_ERROR` with detailed error code `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#ERROR_INVALID_PORT` will be returned. The port index is invalid if one of the following requirements is met:

- index is beyond the range of `https://developer.android.com/reference/android/telephony/UiccCardInfo#getPorts()`.
- In SS(Single SIM) mode, the embedded slot already has an active port with different port index.
- In DSDS mode, if the psim slot is active and the embedded slot already has an active empty port with different port index.

Depending on the target port and permission check, an `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR` might be returned to the callback intent to prompt the user to authorize before the switch.   

Requires android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS

<br />

| Parameters ||
|---|---|
| `subscriptionId` | `int`: the ID of the subscription to enable. May be `https://developer.android.com/reference/android/telephony/SubscriptionManager#INVALID_SUBSCRIPTION_ID` to deactivate the current profile without activating another profile to replace it. If it's a disable operation, requires the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` permission, or the calling app must be authorized to manage the active subscription on the target eUICC. From Android T, multiple enabled profiles is supported. Calling apps targeting on android T must use `https://developer.android.com/reference/android/telephony/euicc/EuiccManager#switchToSubscription(int,%20int,%20android.app.PendingIntent)` API for disable profile, port index can be found from `https://developer.android.com/reference/android/telephony/SubscriptionInfo#getPortIndex()`. <br /> |
| `portIndex` | `int`: the index of the port to target for the enabled subscription <br /> |
| `callbackIntent` | `PendingIntent`: a PendingIntent to launch when the operation completes. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |

### updateSubscriptionNickname

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void updateSubscriptionNickname (int subscriptionId, 
                String nickname, 
                PendingIntent callbackIntent)
```

Update the nickname for the given subscription.

Requires that the calling app has carrier privileges according to the metadata of the profile to be updated, or the `android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS` permission.   

Requires android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS

<br />

| Parameters ||
|---|---|
| `subscriptionId` | `int`: the ID of the subscription to update. <br /> |
| `nickname` | `String`: the new nickname to apply. This value may be `null`. <br /> |
| `callbackIntent` | `PendingIntent`: a PendingIntent to launch when the operation completes. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If the device does not have `https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TELEPHONY_EUICC`. |