From eb2712bb2f88ee817ff8ceed0f8057e29717f38e Mon Sep 17 00:00:00 2001 From: Muralidhar Reddy Date: Mon, 27 Dec 2021 11:43:15 +0000 Subject: [PATCH] [MEP] Do not pass portIndex to disableProfile, derive portIndex from the passing iccid. Partially revert T API change ag/15808958, disableProfile remains unchanged for Android T Bug: 211955076 Test: manual, atest FrameworksTelephonyTests Change-Id: I5803251e6ecaac1d8a19c7d6870fb4f8382048b1 --- core/api/system-current.txt | 3 +- .../telephony/euicc/EuiccCardManager.java | 38 +------------------ .../telephony/euicc/IEuiccCardController.aidl | 4 +- 3 files changed, 4 insertions(+), 41 deletions(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index fc35905875c22..181f9ded086ba 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -13305,8 +13305,7 @@ package android.telephony.euicc { method public void authenticateServer(String, String, byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback); method public void cancelSession(String, byte[], @android.telephony.euicc.EuiccCardManager.CancelReason int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback); method public void deleteProfile(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback); - method @Deprecated public void disableProfile(String, String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback); - method public void disableProfile(@Nullable String, @Nullable String, int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.euicc.EuiccCardManager.ResultCallback); + method public void disableProfile(String, String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback); method public void listNotifications(String, @android.telephony.euicc.EuiccNotification.Event int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback); method public void loadBoundProfilePackage(String, byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback); method public void prepareDownload(String, @Nullable byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback); diff --git a/telephony/java/android/telephony/euicc/EuiccCardManager.java b/telephony/java/android/telephony/euicc/EuiccCardManager.java index 4efd159a289b2..f614988d1950c 100644 --- a/telephony/java/android/telephony/euicc/EuiccCardManager.java +++ b/telephony/java/android/telephony/euicc/EuiccCardManager.java @@ -262,48 +262,12 @@ public class EuiccCardManager { * @param refresh Whether sending the REFRESH command to modem. * @param executor The executor through which the callback should be invoked. * @param callback The callback to get the result code. - * @deprecated instead use {@link #disableProfile(String, String, int, boolean, Executor, - * ResultCallback)} */ - @Deprecated public void disableProfile(String cardId, String iccid, boolean refresh, @CallbackExecutor Executor executor, ResultCallback callback) { try { getIEuiccCardController().disableProfile(mContext.getOpPackageName(), cardId, iccid, - TelephonyManager.DEFAULT_PORT_INDEX, refresh, - new IDisableProfileCallback.Stub() { - @Override - public void onComplete(int resultCode) { - final long token = Binder.clearCallingIdentity(); - try { - executor.execute(() -> callback.onComplete(resultCode, null)); - } finally { - Binder.restoreCallingIdentity(token); - } - } - }); - } catch (RemoteException e) { - Log.e(TAG, "Error calling disableProfile", e); - throw e.rethrowFromSystemServer(); - } - } - - /** - * Disables the profile of the given ICCID. - * - * @param cardId The Id of the eUICC. - * @param iccid The iccid of the profile. - * @param portIndex the Port index is the unique index referring to a port. - * @param refresh Whether sending the REFRESH command to modem. - * @param executor The executor through which the callback should be invoked. - * @param callback The callback to get the result code. - */ - public void disableProfile(@Nullable String cardId, @Nullable String iccid, int portIndex, - boolean refresh, @NonNull @CallbackExecutor Executor executor, - @NonNull ResultCallback callback) { - try { - getIEuiccCardController().disableProfile(mContext.getOpPackageName(), cardId, iccid, - portIndex, refresh, new IDisableProfileCallback.Stub() { + refresh, new IDisableProfileCallback.Stub() { @Override public void onComplete(int resultCode) { final long token = Binder.clearCallingIdentity(); diff --git a/telephony/java/com/android/internal/telephony/euicc/IEuiccCardController.aidl b/telephony/java/com/android/internal/telephony/euicc/IEuiccCardController.aidl index 1734c982ffb4d..928223a309330 100644 --- a/telephony/java/com/android/internal/telephony/euicc/IEuiccCardController.aidl +++ b/telephony/java/com/android/internal/telephony/euicc/IEuiccCardController.aidl @@ -47,8 +47,8 @@ interface IEuiccCardController { in IGetProfileCallback callback); oneway void getEnabledProfile(String callingPackage, String cardId, int portIndex, in IGetProfileCallback callback); - oneway void disableProfile(String callingPackage, String cardId, String iccid, int portIndex, - boolean refresh, in IDisableProfileCallback callback); + oneway void disableProfile(String callingPackage, String cardId, String iccid, boolean refresh, + in IDisableProfileCallback callback); oneway void switchToProfile(String callingPackage, String cardId, String iccid, int portIndex, boolean refresh, in ISwitchToProfileCallback callback); oneway void setNickname(String callingPackage, String cardId, String iccid, String nickname,