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

Commit dbc7589c authored by Muralidhar Reddy's avatar Muralidhar Reddy
Browse files

Add portIndex to EuiccService#GetMetaData API

Include portIndex in metadata API to perform port sensitive operations.

Test: Manual test on Pixel 7, atest FrameworksTelephonyTests
Bug: 247657227
Change-Id: I7e2df4879bfa55815541b29a1e3f7a82ea11d5b0
parent 7c3fd303
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11606,6 +11606,7 @@ package android.service.euicc {
    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.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 @NonNull public abstract android.telephony.euicc.EuiccInfo onGetEuiccInfo(int);
    method @NonNull public abstract android.service.euicc.GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int);
+41 −4
Original line number Diff line number Diff line
@@ -489,6 +489,28 @@ public abstract class EuiccService extends Service {
    public abstract GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(
            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.
     *
@@ -833,16 +855,31 @@ public abstract class EuiccService extends Service {
        }

        @Override
        public void getDownloadableSubscriptionMetadata(int slotId,
        public void getDownloadableSubscriptionMetadata(int slotId, int portIndex,
                DownloadableSubscription subscription,
                boolean forceDeactivateSim,
                boolean switchAfterDownload, boolean forceDeactivateSim,
                IGetDownloadableSubscriptionMetadataCallback callback) {
            mExecutor.execute(new Runnable() {
                @Override
                public void run() {
                    GetDownloadableSubscriptionMetadataResult result =
                            EuiccService.this.onGetDownloadableSubscriptionMetadata(
                    GetDownloadableSubscriptionMetadataResult result;
                    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);
                        }
                    } else {
                        // When switchAfterDownload is false, this operation is port agnostic.
                        // Call API without portIndex.
                        result = EuiccService.this.onGetDownloadableSubscriptionMetadata(
                                slotId, subscription, forceDeactivateSim);
                    }
                    try {
                        callback.onComplete(result);
                    } catch (RemoteException e) {
+4 −2
Original line number Diff line number Diff line
@@ -38,8 +38,10 @@ oneway interface IEuiccService {
    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 getDownloadableSubscriptionMetadata(
            int slotId, int portIndex, in DownloadableSubscription subscription,
            boolean switchAfterDownload, boolean forceDeactivateSim,
            in IGetDownloadableSubscriptionMetadataCallback callback);
    void getEid(int slotId, in IGetEidCallback callback);
    void getOtaStatus(int slotId, in IGetOtaStatusCallback callback);
    void startOtaIfNecessary(int slotId, in IOtaStatusChangedCallback statusChangedCallback);