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

Commit 755e1bc3 authored by Joonhun Shin's avatar Joonhun Shin Committed by Android (Google) Code Review
Browse files

Merge "Enforce map the telephony features with APIs in EuiccCardManager, EuiccManager" into main

parents fad3796f 60b2a8e0
Loading
Loading
Loading
Loading
+72 −0
Original line number Diff line number Diff line
@@ -183,6 +183,9 @@ public class EuiccCardManager {
     * @param cardId   The Id of the eUICC.
     * @param executor The executor through which the callback should be invoked.
     * @param callback The callback to get the result code and all the profiles.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestAllProfiles(String cardId, @CallbackExecutor Executor executor,
            ResultCallback<EuiccProfileInfo[]> callback) {
@@ -212,6 +215,9 @@ public class EuiccCardManager {
     * @param iccid    The iccid of the profile.
     * @param executor The executor through which the callback should be invoked.
     * @param callback The callback to get the result code and profile.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestProfile(String cardId, String iccid, @CallbackExecutor Executor executor,
            ResultCallback<EuiccProfileInfo> callback) {
@@ -244,6 +250,9 @@ public class EuiccCardManager {
     *                  ICCID is known, an APDU will be sent through to read the enabled profile.
     * @param executor  The executor through which the callback should be invoked.
     * @param callback  The callback to get the result code and the profile.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestEnabledProfileForPort(@NonNull String cardId, int portIndex,
            @NonNull @CallbackExecutor Executor executor,
@@ -276,6 +285,9 @@ 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.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void disableProfile(String cardId, String iccid, boolean refresh,
            @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
@@ -307,6 +319,9 @@ 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 and the EuiccProfileInfo enabled.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @deprecated instead use {@link #switchToProfile(String, String, int, boolean, Executor,
     * ResultCallback)}
     */
@@ -344,6 +359,9 @@ 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 and the EuiccProfileInfo enabled.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void switchToProfile(@Nullable String cardId, @Nullable String iccid, int portIndex,
            boolean refresh, @NonNull @CallbackExecutor Executor executor,
@@ -375,6 +393,9 @@ public class EuiccCardManager {
     * @param nickname The nickname of the profile.
     * @param executor The executor through which the callback should be invoked.
     * @param callback The callback to get the result code.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void setNickname(String cardId, String iccid, String nickname,
            @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
@@ -404,6 +425,9 @@ public class EuiccCardManager {
     * @param iccid The iccid of the profile.
     * @param executor The executor through which the callback should be invoked.
     * @param callback The callback to get the result code.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void deleteProfile(String cardId, String iccid, @CallbackExecutor Executor executor,
            ResultCallback<Void> callback) {
@@ -434,6 +458,9 @@ public class EuiccCardManager {
     *     EuiccCard for details.
     * @param executor The executor through which the callback should be invoked.
     * @param callback The callback to get the result code.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void resetMemory(String cardId, @ResetOption int options,
            @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
@@ -462,6 +489,9 @@ public class EuiccCardManager {
     * @param cardId The Id of the eUICC.
     * @param executor The executor through which the callback should be invoked.
     * @param callback The callback to get the result code and the default SM-DP+ address.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestDefaultSmdpAddress(String cardId, @CallbackExecutor Executor executor,
            ResultCallback<String> callback) {
@@ -490,6 +520,9 @@ public class EuiccCardManager {
     * @param cardId The Id of the eUICC.
     * @param executor The executor through which the callback should be invoked.
     * @param callback The callback to get the result code and the SM-DS address.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestSmdsAddress(String cardId, @CallbackExecutor Executor executor,
            ResultCallback<String> callback) {
@@ -519,6 +552,9 @@ public class EuiccCardManager {
     * @param defaultSmdpAddress The default SM-DP+ address to set.
     * @param executor The executor through which the callback should be invoked.
     * @param callback The callback to get the result code.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void setDefaultSmdpAddress(String cardId, String defaultSmdpAddress,
            @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
@@ -548,6 +584,9 @@ public class EuiccCardManager {
     * @param cardId The Id of the eUICC.
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and the rule authorisation table.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestRulesAuthTable(String cardId, @CallbackExecutor Executor executor,
            ResultCallback<EuiccRulesAuthTable> callback) {
@@ -576,6 +615,9 @@ public class EuiccCardManager {
     * @param cardId The Id of the eUICC.
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and the challenge.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestEuiccChallenge(String cardId, @CallbackExecutor Executor executor,
            ResultCallback<byte[]> callback) {
@@ -604,6 +646,9 @@ public class EuiccCardManager {
     * @param cardId The Id of the eUICC.
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and the info1.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestEuiccInfo1(String cardId, @CallbackExecutor Executor executor,
            ResultCallback<byte[]> callback) {
@@ -632,6 +677,9 @@ public class EuiccCardManager {
     * @param cardId The Id of the eUICC.
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and the info2.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void requestEuiccInfo2(String cardId, @CallbackExecutor Executor executor,
            ResultCallback<byte[]> callback) {
@@ -671,6 +719,9 @@ public class EuiccCardManager {
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and a byte array which represents a
     *     {@code AuthenticateServerResponse} defined in GSMA RSP v2.0+.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void authenticateServer(String cardId, String matchingId, byte[] serverSigned1,
            byte[] serverSignature1, byte[] euiccCiPkIdToBeUsed, byte[] serverCertificate,
@@ -716,6 +767,9 @@ public class EuiccCardManager {
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and a byte array which represents a
     *     {@code PrepareDownloadResponse} defined in GSMA RSP v2.0+
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void prepareDownload(String cardId, @Nullable byte[] hashCc, byte[] smdpSigned2,
            byte[] smdpSignature2, byte[] smdpCertificate, @CallbackExecutor Executor executor,
@@ -753,6 +807,9 @@ public class EuiccCardManager {
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and a byte array which represents a
     *     {@code LoadBoundProfilePackageResponse} defined in GSMA RSP v2.0+.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void loadBoundProfilePackage(String cardId, byte[] boundProfilePackage,
            @CallbackExecutor Executor executor, ResultCallback<byte[]> callback) {
@@ -787,6 +844,9 @@ public class EuiccCardManager {
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and an byte[] which represents a
     *     {@code CancelSessionResponse} defined in GSMA RSP v2.0+.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void cancelSession(String cardId, byte[] transactionId, @CancelReason int reason,
            @CallbackExecutor Executor executor, ResultCallback<byte[]> callback) {
@@ -820,6 +880,9 @@ public class EuiccCardManager {
     * @param events bits of the event types ({@link EuiccNotification.Event}) to list.
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and the list of notifications.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void listNotifications(String cardId, @EuiccNotification.Event int events,
            @CallbackExecutor Executor executor, ResultCallback<EuiccNotification[]> callback) {
@@ -850,6 +913,9 @@ public class EuiccCardManager {
     * @param events bits of the event types ({@link EuiccNotification.Event}) to list.
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and the list of notifications.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void retrieveNotificationList(String cardId, @EuiccNotification.Event int events,
            @CallbackExecutor Executor executor, ResultCallback<EuiccNotification[]> callback) {
@@ -880,6 +946,9 @@ public class EuiccCardManager {
     * @param seqNumber the sequence number of the notification.
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code and the notification.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void retrieveNotification(String cardId, int seqNumber,
            @CallbackExecutor Executor executor, ResultCallback<EuiccNotification> callback) {
@@ -910,6 +979,9 @@ public class EuiccCardManager {
     * @param seqNumber the sequence number of the notification.
     * @param executor The executor through which the callback should be invoked.
     * @param callback the callback to get the result code.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public void removeNotificationFromList(String cardId, int seqNumber,
            @CallbackExecutor Executor executor, ResultCallback<Void> callback) {
+57 −0
Original line number Diff line number Diff line
@@ -927,6 +927,9 @@ public class EuiccManager {
     * subscription APIs.
     *
     * @return true if embedded subscriptions are currently enabled.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public boolean isEnabled() {
        // In the future, this may reach out to IEuiccController (if non-null) to check any dynamic
@@ -942,6 +945,9 @@ public class EuiccManager {
     * access to the EID of another eUICC.
     *
     * @return the EID. May be null if the eUICC is not ready.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    @Nullable
    public String getEid() {
@@ -963,6 +969,8 @@ public class EuiccManager {
     * @return the status of eUICC OTA. If the eUICC is not ready,
     *         {@link OtaStatus#EUICC_OTA_STATUS_UNAVAILABLE} will be returned.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1014,6 +1022,9 @@ public class EuiccManager {
     * @param subscription the subscription to download.
     * @param switchAfterDownload if true, the profile will be activated upon successful download.
     * @param callbackIntent a PendingIntent to launch when the operation completes.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    @RequiresPermission(Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS)
    public void downloadSubscription(DownloadableSubscription subscription,
@@ -1075,6 +1086,9 @@ public class EuiccManager {
     * @param resolutionExtras Resolution-specific extras depending on the result of the resolution.
     *     For example, this may indicate whether the user has consented or may include the input
     *     they provided.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1111,6 +1125,9 @@ public class EuiccManager {
     *
     * @param subscription the subscription which needs metadata filled in
     * @param callbackIntent a PendingIntent to launch when the operation completes.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1142,6 +1159,9 @@ public class EuiccManager {
     * internal system use only.
     *
     * @param callbackIntent a PendingIntent to launch when the operation completes.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1163,6 +1183,9 @@ public class EuiccManager {
     * Returns information about the eUICC chip/device.
     *
     * @return the {@link EuiccInfo}. May be null if the eUICC is not ready.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    @Nullable
    public EuiccInfo getEuiccInfo() {
@@ -1188,6 +1211,9 @@ public class EuiccManager {
     *
     * @param subscriptionId the ID of the subscription to delete.
     * @param callbackIntent a PendingIntent to launch when the operation completes.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    @RequiresPermission(Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS)
    public void deleteSubscription(int subscriptionId, PendingIntent callbackIntent) {
@@ -1251,6 +1277,9 @@ public class EuiccManager {
     *     {@code android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission, or the
     *     calling app must be authorized to manage the active subscription on the target eUICC.
     * @param callbackIntent a PendingIntent to launch when the operation completes.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    @RequiresPermission(Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS)
    public void switchToSubscription(int subscriptionId, PendingIntent callbackIntent) {
@@ -1312,6 +1341,9 @@ public class EuiccManager {
     *     {@link SubscriptionInfo#getPortIndex()}.
     * @param portIndex the index of the port to target for the enabled subscription
     * @param callbackIntent a PendingIntent to launch when the operation completes.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    @RequiresPermission(Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS)
    public void switchToSubscription(int subscriptionId, int portIndex,
@@ -1349,6 +1381,9 @@ public class EuiccManager {
     * @param subscriptionId the ID of the subscription to update.
     * @param nickname the new nickname to apply.
     * @param callbackIntent a PendingIntent to launch when the operation completes.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    @RequiresPermission(Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS)
    public void updateSubscriptionNickname(
@@ -1376,6 +1411,8 @@ public class EuiccManager {
     * @deprecated From R, callers should specify a flag for specific set of subscriptions to erase
     * and use {@link #eraseSubscriptions(int, PendingIntent)} instead
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1402,6 +1439,8 @@ public class EuiccManager {
     * @param options flag indicating specific set of subscriptions to erase
     * @param callbackIntent a PendingIntent to launch when the operation completes.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1459,6 +1498,9 @@ public class EuiccManager {
     * determine whether a country is supported please check {@link #isSupportedCountry}.
     *
     * @param supportedCountries is a list of strings contains country ISO codes in uppercase.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1487,6 +1529,9 @@ public class EuiccManager {
     * determine whether a country is supported please check {@link #isSupportedCountry}.
     *
     * @param unsupportedCountries is a list of strings contains country ISO codes in uppercase.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1512,6 +1557,9 @@ public class EuiccManager {
     * {@code android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission.
     *
     * @return list of strings contains country ISO codes in uppercase.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1535,6 +1583,9 @@ public class EuiccManager {
     * {@code android.Manifest.permission#WRITE_EMBEDDED_SUBSCRIPTIONS} permission.
     *
     * @return list of strings contains country ISO codes in uppercase.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1566,6 +1617,9 @@ public class EuiccManager {
     * @param countryIso should be the ISO-3166 country code is provided in uppercase 2 character
     * format.
     * @return whether the given country supports eUICC or not.
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     * @hide
     */
    @SystemApi
@@ -1630,6 +1684,9 @@ public class EuiccManager {
     *
     * @param portIndex is an enumeration of the ports available on the UICC.
     * @return {@code true} if port is available
     *
     * @throws UnsupportedOperationException If the device does not have
     *          {@link PackageManager#FEATURE_TELEPHONY_EUICC}.
     */
    public boolean isSimPortAvailable(int portIndex) {
        try {