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

This commit is contained in:
Jiuyu Sun
2018-03-28 04:18:51 +00:00
committed by Android (Google) Code Review
6 changed files with 32 additions and 13 deletions

View File

@@ -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";
}

View File

@@ -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";
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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() {

View File

@@ -142,11 +142,9 @@ public class EuiccManager {
"android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE";
/**
* Key for an extra set on {@link #getDownloadableSubscriptionMetadata} PendingIntent result
* Key for an extra set on {@code #getDownloadableSubscriptionMetadata} PendingIntent result
* callbacks providing the downloadable subscription metadata.
* @hide
*/
@SystemApi
public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION =
"android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION";