From 29d2181bd2f0d35dd40bf6499380c63f928f6dcf Mon Sep 17 00:00:00 2001 From: Muralidhar Reddy Date: Fri, 25 Feb 2022 12:37:08 +0000 Subject: [PATCH] [MEP] Handle downloadSubscription with switchAfterDownload is set to true 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. Also If cannot resolve port Index, request user confirmation with new UX dialog to support MEP feature. Bug: 220060771 Test: Manual test with Fi, atest FrameworksTelephonyTests Change-Id: Id27bdc3d802bb5f2fb3459ec62be75365a2222b8 --- .../android/service/euicc/EuiccService.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/telephony/java/android/service/euicc/EuiccService.java b/telephony/java/android/service/euicc/EuiccService.java index 8d92520195386..7129a27c3cd6c 100644 --- a/telephony/java/android/service/euicc/EuiccService.java +++ b/telephony/java/android/service/euicc/EuiccService.java @@ -29,7 +29,6 @@ import android.content.Intent; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; -import android.telephony.TelephonyManager; import android.telephony.euicc.DownloadableSubscription; import android.telephony.euicc.EuiccInfo; import android.telephony.euicc.EuiccManager; @@ -744,18 +743,16 @@ public abstract class EuiccService extends Service { public void run() { DownloadSubscriptionResult result; try { - result = - EuiccService.this.onDownloadSubscription( - slotId, subscription, switchAfterDownload, forceDeactivateSim, - resolvedBundle); + result = EuiccService.this.onDownloadSubscription( + slotId, portIndex, subscription, switchAfterDownload, + forceDeactivateSim, resolvedBundle); } catch (AbstractMethodError e) { - Log.w(TAG, "The new onDownloadSubscription(int, " + Log.w(TAG, "The new onDownloadSubscription(int, int, " + "DownloadableSubscription, boolean, boolean, Bundle) is not " + "implemented. Fall back to the old one.", e); - int resultCode = EuiccService.this.onDownloadSubscription( - slotId, subscription, switchAfterDownload, forceDeactivateSim); - result = new DownloadSubscriptionResult(resultCode, - 0 /* resolvableErrors */, TelephonyManager.UNSUPPORTED_CARD_ID); + result = EuiccService.this.onDownloadSubscription( + slotId, subscription, switchAfterDownload, + forceDeactivateSim, resolvedBundle); } try { callback.onComplete(result);