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

Commit a78a764f authored by Jiuyu Sun's avatar Jiuyu Sun Committed by Android (Google) Code Review
Browse files

Merge "Address comments from API Review." into pi-dev

parents 0c1c9cd7 59159c43
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -42676,6 +42676,7 @@ package android.telephony.euicc {
    field public static final int EMBEDDED_SUBSCRIPTION_RESULT_OK = 0; // 0x0
    field public static final int EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR = 1; // 0x1
    field public static final java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE";
    field public static final java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION";
    field public static final java.lang.String META_DATA_CARRIER_ICON = "android.telephony.euicc.carriericon";
  }
+0 −1
Original line number Diff line number Diff line
@@ -5501,7 +5501,6 @@ package android.telephony.euicc {
    field public static final int EUICC_OTA_NOT_NEEDED = 4; // 0x4
    field public static final int EUICC_OTA_STATUS_UNAVAILABLE = 5; // 0x5
    field public static final int EUICC_OTA_SUCCEEDED = 3; // 0x3
    field public static final java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION";
    field public static final java.lang.String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS";
  }

+1 −1
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ public class SubscriptionInfo implements Parcelable {
        return this.mCountryIso;
    }

    /** @return whether the subscription is an embedded one. */
    /** @return whether the subscription is an eUICC one. */
    public boolean isEmbedded() {
        return this.mIsEmbedded;
    }
+8 −6
Original line number Diff line number Diff line
@@ -1925,26 +1925,28 @@ public class SubscriptionManager {
     *
     * @param info The subscription to check.
     * @return whether the app is authorized to manage this subscription per its metadata.
     * @throws UnsupportedOperationException if this subscription is not embedded.
     * @throws IllegalArgumentException if this subscription is not embedded.
     */
    public boolean canManageSubscription(SubscriptionInfo info) {
        return canManageSubscription(info, mContext.getPackageName());
    }

    /**
     * Checks whether the given app is authorized to manage the given subscription according to its
     * metadata. Only supported for embedded subscriptions (if {@code SubscriptionInfo#isEmbedded}
     * Checks whether the given app is authorized to manage the given subscription. An app can only
     * be authorized if it is included in the {@link android.telephony.UiccAccessRule} of the
     * {@link android.telephony.SubscriptionInfo} with the access status.
     * Only supported for embedded subscriptions (if {@link SubscriptionInfo#isEmbedded}
     * returns true).
     *
     * @param info The subscription to check.
     * @param packageName Package name of the app to check.
     * @return whether the app is authorized to manage this subscription per its metadata.
     * @throws UnsupportedOperationException if this subscription is not embedded.
     * @return whether the app is authorized to manage this subscription per its access rules.
     * @throws IllegalArgumentException if this subscription is not embedded.
     * @hide
     */
    public boolean canManageSubscription(SubscriptionInfo info, String packageName) {
        if (!info.isEmbedded()) {
            throw new UnsupportedOperationException("Not an embedded subscription");
            throw new IllegalArgumentException("Not an embedded subscription");
        }
        if (info.getAccessRules() == null) {
            return false;
+21 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package android.telephony.euicc;

import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.app.PendingIntent;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.UiccAccessRule;
@@ -26,7 +27,14 @@ import java.util.List;

import com.android.internal.util.Preconditions;

/** Information about a subscription which is available for download. */
/**
 * Information about a subscription which is downloadable to an eUICC using
 * {@link EuiccManager#downloadSubscription(DownloadableSubscription, boolean, PendingIntent).
 *
 * <p>For example, a DownloadableSubscription can be created through an activation code parsed from
 * a QR code. A server address can be parsed from the activation code to download more information
 * about the profile, such as carrier name, access rules, etc.
 */
public final class DownloadableSubscription implements Parcelable {

    public static final Creator<DownloadableSubscription> CREATOR =
@@ -136,7 +144,15 @@ public final class DownloadableSubscription implements Parcelable {
    /**
     * Create a DownloadableSubscription for the given activation code.
     *
     * @param encodedActivationCode the activation code to use. Must not be null.
     * <p>This fills the encodedActivationCode field. Other fields like confirmationCode,
     * carrierName and accessRules may be filled in the implementation of
     * {@code android.service.euicc.EuiccService} if exists.
     *
     * @param encodedActivationCode the activation code to use. An activation code can be parsed
     *         from a user scanned QR code. The format of activation code is defined in SGP.22. For
     *         example, "1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$1.3.6.1.4.1.31746". For detail, see
     *         {@code com.android.euicc.data.ActivationCode}. Must not be null.
     *
     * @return the {@link DownloadableSubscription} which may be passed to
     *     {@link EuiccManager#downloadSubscription}.
     */
@@ -157,6 +173,9 @@ public final class DownloadableSubscription implements Parcelable {

    /**
     * Returns the confirmation code.
     *
     * <p>As an example, the confirmation code can be input by the user through a carrier app or the
     * UI component of the eUICC local profile assistant (LPA) application.
     */
    @Nullable
    public String getConfirmationCode() {
Loading