Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c22236c authored by Chen Xu's avatar Chen Xu
Browse files

A overloaded API for downloadSubscription with portIndex for LPA

Most of cases, download opperation is port agnostic we don't need
to specify the portIndex. However if this is triggered from carier
apps and apps specify download followed with esim activation, then
platform need to resolve a portIndex(maybe through UX) and need to
pass this portIndex to LPA app. thus we need to add an overloaded
version of download API for LPA.

Bug: 214055002
Test: Build & atest EuiccServiceTest
Change-Id: If127224ca7ca696c8eb512dc80c27f54e4f25b38
parent 58956e4a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -11065,7 +11065,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);
+36 −1
Original line number Diff line number Diff line
@@ -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() {
+3 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import android.os.Bundle;

/** @hide */
oneway interface IEuiccService {
    void downloadSubscription(int slotId, in DownloadableSubscription subscription,
    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,