From 44d67194c27b2778d13219cd164329f1ecae7228 Mon Sep 17 00:00:00 2001 From: Chen Xu Date: Tue, 8 Feb 2022 21:04:43 -0800 Subject: [PATCH] return null for requestEnabledProfileForPort if no profile enabled Previously we return an error code if there is no profile enabled on the port. we shouldn't really treat this as an "error" as no profile enabled is a valid scenario. Bug: 218481513 Test: Build & Manual Change-Id: I31c57826c35eeb50759d170d13b8222c55622760 --- core/api/system-current.txt | 2 +- .../java/android/telephony/euicc/EuiccCardManager.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 6267dbf376f77..0c6ef36c57f5c 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -13805,7 +13805,7 @@ package android.telephony.euicc { field public static final int RESULT_CALLER_NOT_ALLOWED = -3; // 0xfffffffd field public static final int RESULT_EUICC_NOT_FOUND = -2; // 0xfffffffe field public static final int RESULT_OK = 0; // 0x0 - field public static final int RESULT_PROFILE_NOT_FOUND = -4; // 0xfffffffc + field public static final int RESULT_PROFILE_NOT_FOUND = 1; // 0x1 field public static final int RESULT_UNKNOWN_ERROR = -1; // 0xffffffff } diff --git a/telephony/java/android/telephony/euicc/EuiccCardManager.java b/telephony/java/android/telephony/euicc/EuiccCardManager.java index f614988d1950c..0a2bb3d16f249 100644 --- a/telephony/java/android/telephony/euicc/EuiccCardManager.java +++ b/telephony/java/android/telephony/euicc/EuiccCardManager.java @@ -118,6 +118,9 @@ public class EuiccCardManager { /** Resets the default SM-DP+ address. */ public static final int RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS = 1 << 2; + /** Result code when the requested profile is not found */ + public static final int RESULT_PROFILE_NOT_FOUND = 1; + /** Result code of execution with no error. */ public static final int RESULT_OK = 0; @@ -130,9 +133,6 @@ public class EuiccCardManager { /** Result code indicating the caller is not the active LPA. */ public static final int RESULT_CALLER_NOT_ALLOWED = -3; - /** Result code when the requested profile is not found */ - public static final int RESULT_PROFILE_NOT_FOUND = -4; - /** * Callback to receive the result of an eUICC card API. * @@ -223,7 +223,9 @@ public class EuiccCardManager { } /** - * Requests the enabled profile for a given port on an eUicc. + * Requests the enabled profile for a given port on an eUicc. Callback with result code + * {@link RESULT_PROFILE_NOT_FOUND} and {@code NULL} EuiccProfile if there is no enabled + * profile on the target port. * * @param cardId The Id of the eUICC. * @param portIndex The portIndex to use. The port may be active or inactive. As long as the