/**@class android.service.euicc.EuiccService @extends android.app.Service Service interface linking the system with an eUICC local profile assistant (LPA) application. <p>An LPA consists of two separate components (which may both be implemented in the same APK): the LPA backend, and the LPA UI or LUI. <p>To implement the LPA backend, you must extend this class and declare this service in your manifest file. The service must require the {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission and include an intent filter with the {@link #EUICC_SERVICE_INTERFACE} action. It's suggested that the priority of the intent filter to be set to a non-zero value in case multiple implementations are present on the device. See the below example. Note that there will be problem if two LPAs are present and they have the same priority. Example: <pre>{@code <service android:name=".MyEuiccService" android:permission="android.permission.BIND_EUICC_SERVICE"> <intent-filter android:priority="100"> <action android:name="android.service.euicc.EuiccService" /> </intent-filter> </service> }</pre> <p>To implement the LUI, you must provide an activity for the following actions: <ul> <li>{@link #ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS} <li>{@link #ACTION_PROVISION_EMBEDDED_SUBSCRIPTION} </ul> <p>As with the service, each activity must require the {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission. Each should have an intent filter with the appropriate action, the {@link #CATEGORY_EUICC_UI} category, and a non-zero priority. <p>Old implementations of EuiccService may support passing in slot IDs equal to {@link android.telephony.SubscriptionManager#INVALID_SIM_SLOT_INDEX}, which allows the LPA to decide which eUICC to target when there are multiple eUICCs. This behavior is not supported in Android Q or later. @hide */ var EuiccService = { /**Action which must be included in this service's intent filter. */ EUICC_SERVICE_INTERFACE : "android.service.euicc.EuiccService", /**Category which must be defined to all UI actions, for efficient lookup. */ CATEGORY_EUICC_UI : "android.service.euicc.category.EUICC_UI", /** Action used to bind the carrier app and get the activation code from the carrier app. This activation code will be used to download the eSIM profile during eSIM activation flow. */ ACTION_BIND_CARRIER_PROVISIONING_SERVICE : "android.service.euicc.action.BIND_CARRIER_PROVISIONING_SERVICE", /** @see android.telephony.euicc.EuiccManager#ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS The difference is this one is used by system to bring up the LUI. */ ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS : "android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS", /**@see android.telephony.euicc.EuiccManager#ACTION_PROVISION_EMBEDDED_SUBSCRIPTION */ ACTION_PROVISION_EMBEDDED_SUBSCRIPTION : "android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION", /** @see android.telephony.euicc.EuiccManager#ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED. This is a protected intent that can only be sent by the system, and requires the {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission. */ ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED : "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED", /** @see android.telephony.euicc.EuiccManager#ACTION_DELETE_SUBSCRIPTION_PRIVILEGED. This is a protected intent that can only be sent by the system, and requires the {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission. */ ACTION_DELETE_SUBSCRIPTION_PRIVILEGED : "android.service.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED", /** @see android.telephony.euicc.EuiccManager#ACTION_RENAME_SUBSCRIPTION_PRIVILEGED. This is a protected intent that can only be sent by the system, and requires the {@link android.Manifest.permission#BIND_EUICC_SERVICE} permission. */ ACTION_RENAME_SUBSCRIPTION_PRIVILEGED : "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED", /** Alert the user that this action will result in an active SIM being deactivated. To implement the LUI triggered by the system, you need to define this in AndroidManifest.xml. */ ACTION_RESOLVE_DEACTIVATE_SIM : "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM", /** Alert the user about a download/switch being done for an app that doesn't currently have carrier privileges. */ ACTION_RESOLVE_NO_PRIVILEGES : "android.service.euicc.action.RESOLVE_NO_PRIVILEGES", /** Ask the user to input carrier confirmation code. @deprecated From Q, the resolvable errors happened in the download step are presented as bit map in {@link #EXTRA_RESOLVABLE_ERRORS}. The corresponding action would be {@link #ACTION_RESOLVE_RESOLVABLE_ERRORS}. */ ACTION_RESOLVE_CONFIRMATION_CODE : "android.service.euicc.action.RESOLVE_CONFIRMATION_CODE", /**Ask the user to resolve all the resolvable errors. */ ACTION_RESOLVE_RESOLVABLE_ERRORS : "android.service.euicc.action.RESOLVE_RESOLVABLE_ERRORS", /** Possible value for the bit map of resolvable errors indicating the download process needs the user to input confirmation code. */ RESOLVABLE_ERROR_CONFIRMATION_CODE : "1", /** Possible value for the bit map of resolvable errors indicating the download process needs the user's consent to allow profile policy rules. */ RESOLVABLE_ERROR_POLICY_RULES : "2", /** Intent extra set for resolution requests containing the package name of the calling app. This is used by the above actions including ACTION_RESOLVE_DEACTIVATE_SIM, ACTION_RESOLVE_NO_PRIVILEGES and ACTION_RESOLVE_RESOLVABLE_ERRORS. */ EXTRA_RESOLUTION_CALLING_PACKAGE : "android.service.euicc.extra.RESOLUTION_CALLING_PACKAGE", /** Intent extra set for resolution requests containing the list of resolvable errors to be resolved. Each resolvable error is an integer. Its possible values include: <UL> <LI>{@link #RESOLVABLE_ERROR_CONFIRMATION_CODE} <LI>{@link #RESOLVABLE_ERROR_POLICY_RULES} </UL> */ EXTRA_RESOLVABLE_ERRORS : "android.service.euicc.extra.RESOLVABLE_ERRORS", /** Intent extra set for resolution requests containing a boolean indicating whether to ask the user to retry another confirmation code. */ EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED : "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE_RETRIED", /** Intent extra set for resolution requests containing an int indicating the current card Id. */ EXTRA_RESOLUTION_CARD_ID : "android.service.euicc.extra.RESOLUTION_CARD_ID", /**Result code for a successful operation. */ RESULT_OK : "0", /**Result code indicating that an active SIM must be deactivated to perform the operation. */ RESULT_MUST_DEACTIVATE_SIM : "-1", /**Result code indicating that the user must resolve resolvable errors. */ RESULT_RESOLVABLE_ERRORS : "-2", /** Result code indicating that the user must input a carrier confirmation code. @deprecated From Q, the resolvable errors happened in the download step are presented as bit map in {@link #EXTRA_RESOLVABLE_ERRORS}. The corresponding result would be {@link #RESULT_RESOLVABLE_ERRORS}. */ RESULT_NEED_CONFIRMATION_CODE : "-2", /**Start of implementation-specific error results. */ RESULT_FIRST_USER : "1", /** List of all valid resolution actions for validation purposes. @hide */ RESOLUTION_ACTIONS : "null", /** Boolean extra for resolution actions indicating whether the user granted consent. This is used and set by the implementation and used in {@code EuiccOperation}. */ EXTRA_RESOLUTION_CONSENT : "android.service.euicc.extra.RESOLUTION_CONSENT", /** String extra for resolution actions indicating the carrier confirmation code. This is used and set by the implementation and used in {@code EuiccOperation}. */ EXTRA_RESOLUTION_CONFIRMATION_CODE : "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE", /** String extra for resolution actions indicating whether the user allows policy rules. This is used and set by the implementation and used in {@code EuiccOperation}. */ EXTRA_RESOLUTION_ALLOW_POLICY_RULES : "android.service.euicc.extra.RESOLUTION_ALLOW_POLICY_RULES", /** */ onCreate : function( ) {}, /** */ onDestroy : function( ) {}, /**If overriding this method, call through to the super method for any unknown actions. {@inheritDoc} */ onBind : function( ) {}, /**Return the EID of the eUICC. @param {Number} slotId ID of the SIM slot being queried. @return {String} the EID. @see android.telephony.euicc.EuiccManager#getEid */ onGetEid : function( ) {}, /**Return the status of OTA update. @param {Number} slotId ID of the SIM slot to use for the operation. @return {Number} The status of Euicc OTA update. @see android.telephony.euicc.EuiccManager#getOtaStatus */ onGetOtaStatus : function( ) {}, /**Perform OTA if current OS is not the latest one. @param {Number} slotId ID of the SIM slot to use for the operation. @param {Object {EuiccService.OtaStatusChangedCallback}} statusChangedCallback Function called when OTA status changed. */ onStartOtaIfNecessary : function( ) {}, /**Populate {@link DownloadableSubscription} metadata for the given downloadable subscription. @param {Number} slotId ID of the SIM slot to use for the operation. @param {Object {DownloadableSubscription}} subscription A subscription whose metadata needs to be populated. @param {Boolean} forceDeactivateSim If true, and if an active SIM must be deactivated to access the eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)} should be returned to allow the user to consent to this operation first. @return {Object {android.service.euicc.GetDownloadableSubscriptionMetadataResult}} The result of the operation. @see android.telephony.euicc.EuiccManager#getDownloadableSubscriptionMetadata */ onGetDownloadableSubscriptionMetadata : function( ) {}, /**Return metadata for subscriptions which are available for download for this device. @param {Number} slotId ID of the SIM slot to use for the operation. @param {Boolean} forceDeactivateSim If true, and if an active SIM must be deactivated to access the eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM)} should be returned to allow the user to consent to this operation first. @return {Object {android.service.euicc.GetDefaultDownloadableSubscriptionListResult}} The result of the list operation. @see android.telephony.euicc.EuiccManager#getDefaultDownloadableSubscriptionList */ onGetDefaultDownloadableSubscriptionList : function( ) {}, /**Download the given subscription. @param {Number} slotId ID of the SIM slot to use for the operation. @param {Object {DownloadableSubscription}} subscription The subscription to download. @param {Boolean} switchAfterDownload If true, the subscription should be enabled upon successful download. @param {Boolean} forceDeactivateSim If true, and if an active SIM must be deactivated to access the eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM} should be returned to allow the user to consent to this operation first. @param {Object {Bundle}} resolvedBundle The bundle containing information on resolved errors. It can contain a string of confirmation code for the key {@link #EXTRA_RESOLUTION_CONFIRMATION_CODE}, and a boolean for key {@link #EXTRA_RESOLUTION_ALLOW_POLICY_RULES} indicating whether the user allows profile policy rules or not. @return {Object {android.service.euicc.DownloadSubscriptionResult}} a DownloadSubscriptionResult instance including a result code, a resolvable errors bit map, and original the card Id. The result code may be one of the predefined {@code RESULT_} constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. The resolvable error bit map can be either 0 or values defined in {@code RESOLVABLE_ERROR_}. A subclass should override this method. Otherwise, this method does nothing and returns null by default. @see android.telephony.euicc.EuiccManager#downloadSubscription */ onDownloadSubscription : function( ) {}, /**Download the given subscription. @param {Number} slotId ID of the SIM slot to use for the operation. @param {Object {DownloadableSubscription}} subscription The subscription to download. @param {Boolean} switchAfterDownload If true, the subscription should be enabled upon successful download. @param {Boolean} forceDeactivateSim If true, and if an active SIM must be deactivated to access the eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM} should be returned to allow the user to consent to this operation first. @return {Number} the result of the download operation. May be one of the predefined {@code RESULT_} constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. @see android.telephony.euicc.EuiccManager#downloadSubscription @deprecated From Q, a subclass should use and override the above {@link #onDownloadSubscription(int, DownloadableSubscription, boolean, boolean, Bundle)}. The default return value for this one is Integer.MIN_VALUE. */ onDownloadSubscription : function( ) {}, /**Return a list of all @link EuiccProfileInfo}s. @param {Number} slotId ID of the SIM slot to use for the operation. @return {Object {android.service.euicc.GetEuiccProfileInfoListResult}} The result of the operation. @see android.telephony.SubscriptionManager#getAvailableSubscriptionInfoList @see android.telephony.SubscriptionManager#getAccessibleSubscriptionInfoList */ onGetEuiccProfileInfoList : function( ) {}, /**Return info about the eUICC chip/device. @param {Number} slotId ID of the SIM slot to use for the operation. @return {Object {android.telephony.euicc.EuiccInfo}} the {@link EuiccInfo} for the eUICC chip/device. @see android.telephony.euicc.EuiccManager#getEuiccInfo */ onGetEuiccInfo : function( ) {}, /**Delete the given subscription. <p>If the subscription is currently active, it should be deactivated first (equivalent to a physical SIM being ejected). @param {Number} slotId ID of the SIM slot to use for the operation. @param {String} iccid the ICCID of the subscription to delete. @return {Number} the result of the delete operation. May be one of the predefined {@code RESULT_} constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. @see android.telephony.euicc.EuiccManager#deleteSubscription */ onDeleteSubscription : function( ) {}, /**Switch to the given subscription. @param {Number} slotId ID of the SIM slot to use for the operation. @param {String} iccid the ICCID of the subscription to enable. May be null, in which case the current profile should be deactivated and no profile should be activated to replace it - this is equivalent to a physical SIM being ejected. @param {Boolean} forceDeactivateSim If true, and if an active SIM must be deactivated to access the eUICC, perform this action automatically. Otherwise, {@link #RESULT_MUST_DEACTIVATE_SIM} should be returned to allow the user to consent to this operation first. @return {Number} the result of the switch operation. May be one of the predefined {@code RESULT_} constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. @see android.telephony.euicc.EuiccManager#switchToSubscription */ onSwitchToSubscription : function( ) {}, /**Update the nickname of the given subscription. @param {Number} slotId ID of the SIM slot to use for the operation. @param {String} iccid the ICCID of the subscription to update. @param {String} nickname the new nickname to apply. @return {Number} the result of the update operation. May be one of the predefined {@code RESULT_} constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. @see android.telephony.euicc.EuiccManager#updateSubscriptionNickname */ onUpdateSubscriptionNickname : function( ) {}, /**Erase all of the subscriptions on the device. <p>This is intended to be used for device resets. As such, the reset should be performed even if an active SIM must be deactivated in order to access the eUICC. @param {Number} slotId ID of the SIM slot to use for the operation. @return {Number} the result of the erase operation. May be one of the predefined {@code RESULT_} constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. @see android.telephony.euicc.EuiccManager#eraseSubscriptions */ onEraseSubscriptions : function( ) {}, /**Ensure that subscriptions will be retained on the next factory reset. <p>Called directly before a factory reset. Assumes that a normal factory reset will lead to profiles being erased on first boot (to cover fastboot/recovery wipes), so the implementation should persist some bit that will remain accessible after the factory reset to bypass this flow when this method is called. @param {Number} slotId ID of the SIM slot to use for the operation. @return {Number} the result of the operation. May be one of the predefined {@code RESULT_} constants or any implementation-specific code starting with {@link #RESULT_FIRST_USER}. */ onRetainSubscriptionsForFactoryReset : function( ) {}, };