Merge "Add CARD_ID in SubscriptionInfo database"

am: 6745e15d17

Change-Id: I3df57fc50d9e928d74c50b2b99fde63e757e7e78
This commit is contained in:
yinxu
2018-01-20 09:47:20 +00:00
committed by android-build-merger
2 changed files with 44 additions and 6 deletions

View File

@@ -125,6 +125,12 @@ public class SubscriptionInfo implements Parcelable {
@Nullable @Nullable
private UiccAccessRule[] mAccessRules; private UiccAccessRule[] mAccessRules;
/**
* The ID of the SIM card. It is the ICCID of the active profile for a UICC card and the EID
* for an eUICC card.
*/
private String mCardId;
/** /**
* @hide * @hide
*/ */
@@ -133,7 +139,7 @@ public class SubscriptionInfo implements Parcelable {
Bitmap icon, int mcc, int mnc, String countryIso) { Bitmap icon, int mcc, int mnc, String countryIso) {
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */, roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */,
null /* accessRules */); null /* accessRules */, null /* accessRules */);
} }
/** /**
@@ -143,6 +149,17 @@ public class SubscriptionInfo implements Parcelable {
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
Bitmap icon, int mcc, int mnc, String countryIso, boolean isEmbedded, Bitmap icon, int mcc, int mnc, String countryIso, boolean isEmbedded,
@Nullable UiccAccessRule[] accessRules) { @Nullable UiccAccessRule[] accessRules) {
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, null /* cardId */);
}
/**
* @hide
*/
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
Bitmap icon, int mcc, int mnc, String countryIso, boolean isEmbedded,
@Nullable UiccAccessRule[] accessRules, String cardId) {
this.mId = id; this.mId = id;
this.mIccId = iccId; this.mIccId = iccId;
this.mSimSlotIndex = simSlotIndex; this.mSimSlotIndex = simSlotIndex;
@@ -158,6 +175,7 @@ public class SubscriptionInfo implements Parcelable {
this.mCountryIso = countryIso; this.mCountryIso = countryIso;
this.mIsEmbedded = isEmbedded; this.mIsEmbedded = isEmbedded;
this.mAccessRules = accessRules; this.mAccessRules = accessRules;
this.mCardId = cardId;
} }
/** /**
@@ -387,6 +405,14 @@ public class SubscriptionInfo implements Parcelable {
return mAccessRules; return mAccessRules;
} }
/**
* @return the ID of the SIM card which contains the subscription.
* @hide
*/
public String getCardId() {
return this.mCardId;
}
public static final Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() { public static final Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() {
@Override @Override
public SubscriptionInfo createFromParcel(Parcel source) { public SubscriptionInfo createFromParcel(Parcel source) {
@@ -405,10 +431,11 @@ public class SubscriptionInfo implements Parcelable {
Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source); Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
boolean isEmbedded = source.readBoolean(); boolean isEmbedded = source.readBoolean();
UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR); UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR);
String cardId = source.readString();
return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName,
nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso,
isEmbedded, accessRules); isEmbedded, accessRules, cardId);
} }
@Override @Override
@@ -434,6 +461,7 @@ public class SubscriptionInfo implements Parcelable {
mIconBitmap.writeToParcel(dest, flags); mIconBitmap.writeToParcel(dest, flags);
dest.writeBoolean(mIsEmbedded); dest.writeBoolean(mIsEmbedded);
dest.writeTypedArray(mAccessRules, flags); dest.writeTypedArray(mAccessRules, flags);
dest.writeString(mCardId);
} }
@Override @Override
@@ -459,11 +487,13 @@ public class SubscriptionInfo implements Parcelable {
@Override @Override
public String toString() { public String toString() {
String iccIdToPrint = givePrintableIccid(mIccId); String iccIdToPrint = givePrintableIccid(mIccId);
String cardIdToPrint = givePrintableIccid(mCardId);
return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
+ " displayName=" + mDisplayName + " carrierName=" + mCarrierName + " displayName=" + mDisplayName + " carrierName=" + mCarrierName
+ " nameSource=" + mNameSource + " iconTint=" + mIconTint + " nameSource=" + mNameSource + " iconTint=" + mIconTint
+ " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
+ " mnc " + mMnc + " isEmbedded " + mIsEmbedded + " mnc " + mMnc + " isEmbedded " + mIsEmbedded
+ " accessRules " + Arrays.toString(mAccessRules) + "}"; + " accessRules " + Arrays.toString(mAccessRules)
+ " cardId=" + cardIdToPrint + "}";
} }
} }

View File

@@ -270,6 +270,14 @@ public class SubscriptionManager {
*/ */
public static final String IS_EMBEDDED = "is_embedded"; public static final String IS_EMBEDDED = "is_embedded";
/**
* TelephonyProvider column name for SIM card identifier. For UICC card it is the ICCID of the
* current enabled profile on the card, while for eUICC card it is the EID of the card.
* <P>Type: TEXT (String)</P>
* @hide
*/
public static final String CARD_ID = "card_id";
/** /**
* TelephonyProvider column name for the encoded {@link UiccAccessRule}s from * TelephonyProvider column name for the encoded {@link UiccAccessRule}s from
* {@link UiccAccessRule#encodeRules}. Only present if {@link #IS_EMBEDDED} is 1. * {@link UiccAccessRule#encodeRules}. Only present if {@link #IS_EMBEDDED} is 1.