diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 2a2d08cbd1f0f..8aef638411b79 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -11140,7 +11140,8 @@ package android.service.euicc { method public int encodeSmdxSubjectAndReasonCode(@Nullable String, @Nullable String); method @CallSuper public android.os.IBinder onBind(android.content.Intent); method public abstract int onDeleteSubscription(int, String); - method public android.service.euicc.DownloadSubscriptionResult onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean, @Nullable android.os.Bundle); + method @Deprecated public android.service.euicc.DownloadSubscriptionResult onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean, @Nullable android.os.Bundle); + method @NonNull public android.service.euicc.DownloadSubscriptionResult onDownloadSubscription(int, int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean, @NonNull android.os.Bundle); method @Deprecated public int onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean); method @Deprecated public abstract int onEraseSubscriptions(int); method public int onEraseSubscriptions(int, @android.telephony.euicc.EuiccCardManager.ResetOption int); diff --git a/telephony/java/android/service/euicc/EuiccService.java b/telephony/java/android/service/euicc/EuiccService.java index 30ed7c287421f..8d92520195386 100644 --- a/telephony/java/android/service/euicc/EuiccService.java +++ b/telephony/java/android/service/euicc/EuiccService.java @@ -524,13 +524,47 @@ public abstract class EuiccService extends Service { * 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 + * @deprecated prefer {@link #onDownloadSubscription(int, int, + * DownloadableSubscription, boolean, boolean, Bundle)} */ + @Deprecated public DownloadSubscriptionResult onDownloadSubscription(int slotId, @NonNull DownloadableSubscription subscription, boolean switchAfterDownload, boolean forceDeactivateSim, @Nullable Bundle resolvedBundle) { return null; } + /** + * Download the given subscription. + * + * @param slotIndex Index of the SIM slot to use for the operation. + * @param portIndex Index of the port from the slot. portIndex is used when + * switchAfterDownload is set to {@code true}, otherwise download is port agnostic. + * @param subscription The subscription to download. + * @param switchAfterDownload If true, the subscription should be enabled upon successful + * download. + * @param 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 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 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_}. + * @see android.telephony.euicc.EuiccManager#downloadSubscription + */ + @NonNull + public DownloadSubscriptionResult onDownloadSubscription(int slotIndex, int portIndex, + @NonNull DownloadableSubscription subscription, boolean switchAfterDownload, + boolean forceDeactivateSim, @NonNull Bundle resolvedBundle) { + // stub implementation, LPA needs to implement this + throw new UnsupportedOperationException("LPA must override onDownloadSubscription"); + } + /** * Download the given subscription. * @@ -701,7 +735,8 @@ public abstract class EuiccService extends Service { */ private class IEuiccServiceWrapper extends IEuiccService.Stub { @Override - public void downloadSubscription(int slotId, DownloadableSubscription subscription, + public void downloadSubscription(int slotId, int portIndex, + DownloadableSubscription subscription, boolean switchAfterDownload, boolean forceDeactivateSim, Bundle resolvedBundle, IDownloadSubscriptionCallback callback) { mExecutor.execute(new Runnable() { diff --git a/telephony/java/android/service/euicc/IEuiccService.aidl b/telephony/java/android/service/euicc/IEuiccService.aidl index 030e11aee9934..6b0397d67015e 100644 --- a/telephony/java/android/service/euicc/IEuiccService.aidl +++ b/telephony/java/android/service/euicc/IEuiccService.aidl @@ -35,9 +35,9 @@ import android.os.Bundle; /** @hide */ oneway interface IEuiccService { - void downloadSubscription(int slotId, in DownloadableSubscription subscription, - boolean switchAfterDownload, boolean forceDeactivateSim, in Bundle resolvedBundle, - in IDownloadSubscriptionCallback callback); + void downloadSubscription(int slotId, int portIndex, in DownloadableSubscription subscription, + boolean switchAfterDownload, boolean forceDeactivateSim, in Bundle resolvedBundle, + in IDownloadSubscriptionCallback callback); void getDownloadableSubscriptionMetadata(int slotId, in DownloadableSubscription subscription, boolean forceDeactivateSim, in IGetDownloadableSubscriptionMetadataCallback callback); void getEid(int slotId, in IGetEidCallback callback);