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

Commit 9b6a89bd authored by Muralidhar Reddy Mule's avatar Muralidhar Reddy Mule Committed by Android (Google) Code Review
Browse files

Merge "Add portIndex to EuiccService#GetMetaData API"

parents ccf232a8 dbc7589c
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -11773,6 +11773,7 @@ package android.service.euicc {
    method public int onEraseSubscriptions(int, @android.telephony.euicc.EuiccCardManager.ResetOption int);
    method public int onEraseSubscriptions(int, @android.telephony.euicc.EuiccCardManager.ResetOption int);
    method public abstract android.service.euicc.GetDefaultDownloadableSubscriptionListResult onGetDefaultDownloadableSubscriptionList(int, boolean);
    method public abstract android.service.euicc.GetDefaultDownloadableSubscriptionListResult onGetDefaultDownloadableSubscriptionList(int, boolean);
    method public abstract android.service.euicc.GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(int, android.telephony.euicc.DownloadableSubscription, boolean);
    method public abstract android.service.euicc.GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(int, android.telephony.euicc.DownloadableSubscription, boolean);
    method @NonNull public android.service.euicc.GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(int, int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean);
    method public abstract String onGetEid(int);
    method public abstract String onGetEid(int);
    method @NonNull public abstract android.telephony.euicc.EuiccInfo onGetEuiccInfo(int);
    method @NonNull public abstract android.telephony.euicc.EuiccInfo onGetEuiccInfo(int);
    method @NonNull public abstract android.service.euicc.GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int);
    method @NonNull public abstract android.service.euicc.GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int);
+41 −4
Original line number Original line Diff line number Diff line
@@ -489,6 +489,28 @@ public abstract class EuiccService extends Service {
    public abstract GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(
    public abstract GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(
            int slotId, DownloadableSubscription subscription, boolean forceDeactivateSim);
            int slotId, DownloadableSubscription subscription, boolean forceDeactivateSim);


    /**
     * Populate {@link DownloadableSubscription} metadata for the given downloadable subscription.
     *
     * @param slotId ID of the SIM slot to use for the operation.
     * @param portIndex Index of the port from the slot. portIndex is used if the eUICC must
     *     be activated to perform the operation.
     * @param subscription A subscription whose metadata needs to be populated.
     * @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.
     * @return The result of the operation.
     * @see android.telephony.euicc.EuiccManager#getDownloadableSubscriptionMetadata
     */
    @NonNull
    public GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(
            int slotId, int portIndex, @NonNull DownloadableSubscription subscription,
            boolean forceDeactivateSim) {
        // stub implementation, LPA needs to implement this
        throw new UnsupportedOperationException(
                "LPA must override onGetDownloadableSubscriptionMetadata");
    }

    /**
    /**
     * Return metadata for subscriptions which are available for download for this device.
     * Return metadata for subscriptions which are available for download for this device.
     *
     *
@@ -833,16 +855,31 @@ public abstract class EuiccService extends Service {
        }
        }


        @Override
        @Override
        public void getDownloadableSubscriptionMetadata(int slotId,
        public void getDownloadableSubscriptionMetadata(int slotId, int portIndex,
                DownloadableSubscription subscription,
                DownloadableSubscription subscription,
                boolean forceDeactivateSim,
                boolean switchAfterDownload, boolean forceDeactivateSim,
                IGetDownloadableSubscriptionMetadataCallback callback) {
                IGetDownloadableSubscriptionMetadataCallback callback) {
            mExecutor.execute(new Runnable() {
            mExecutor.execute(new Runnable() {
                @Override
                @Override
                public void run() {
                public void run() {
                    GetDownloadableSubscriptionMetadataResult result =
                    GetDownloadableSubscriptionMetadataResult result;
                            EuiccService.this.onGetDownloadableSubscriptionMetadata(
                    if (switchAfterDownload) {
                        try {
                            result = EuiccService.this.onGetDownloadableSubscriptionMetadata(
                                    slotId, portIndex, subscription, forceDeactivateSim);
                        } catch (UnsupportedOperationException | AbstractMethodError e) {
                            Log.w(TAG, "The new onGetDownloadableSubscriptionMetadata(int, int, "
                                    + "DownloadableSubscription, boolean) is not implemented."
                                    + " Fall back to the old one.", e);
                            result = EuiccService.this.onGetDownloadableSubscriptionMetadata(
                                    slotId, subscription, forceDeactivateSim);
                                    slotId, subscription, forceDeactivateSim);
                        }
                    } else {
                        // When switchAfterDownload is false, this operation is port agnostic.
                        // Call API without portIndex.
                        result = EuiccService.this.onGetDownloadableSubscriptionMetadata(
                                slotId, subscription, forceDeactivateSim);
                    }
                    try {
                    try {
                        callback.onComplete(result);
                        callback.onComplete(result);
                    } catch (RemoteException e) {
                    } catch (RemoteException e) {
+4 −2
Original line number Original line Diff line number Diff line
@@ -38,8 +38,10 @@ oneway interface IEuiccService {
    void downloadSubscription(int slotId, int portIndex, in DownloadableSubscription subscription,
    void downloadSubscription(int slotId, int portIndex, in DownloadableSubscription subscription,
                boolean switchAfterDownload, boolean forceDeactivateSim, in Bundle resolvedBundle,
                boolean switchAfterDownload, boolean forceDeactivateSim, in Bundle resolvedBundle,
                in IDownloadSubscriptionCallback callback);
                in IDownloadSubscriptionCallback callback);
    void getDownloadableSubscriptionMetadata(int slotId, in DownloadableSubscription subscription,
    void getDownloadableSubscriptionMetadata(
            boolean forceDeactivateSim, in IGetDownloadableSubscriptionMetadataCallback callback);
            int slotId, int portIndex, in DownloadableSubscription subscription,
            boolean switchAfterDownload, boolean forceDeactivateSim,
            in IGetDownloadableSubscriptionMetadataCallback callback);
    void getEid(int slotId, in IGetEidCallback callback);
    void getEid(int slotId, in IGetEidCallback callback);
    void getOtaStatus(int slotId, in IGetOtaStatusCallback callback);
    void getOtaStatus(int slotId, in IGetOtaStatusCallback callback);
    void startOtaIfNecessary(int slotId, in IOtaStatusChangedCallback statusChangedCallback);
    void startOtaIfNecessary(int slotId, in IOtaStatusChangedCallback statusChangedCallback);