Merge "Add CARD_ID in SubscriptionInfo database" am: 6745e15d17
am: 33de998afe
Change-Id: I63246ba54d112ef75ca6989c16d7ae979bde552a
This commit is contained in:
@@ -125,15 +125,32 @@ public class SubscriptionInfo implements Parcelable {
|
||||
@Nullable
|
||||
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
|
||||
*/
|
||||
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) {
|
||||
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
||||
roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */,
|
||||
null /* accessRules */, null /* accessRules */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
Bitmap icon, int mcc, int mnc, String countryIso, boolean isEmbedded,
|
||||
@Nullable UiccAccessRule[] accessRules) {
|
||||
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
||||
roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */,
|
||||
null /* accessRules */);
|
||||
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, null /* cardId */);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +159,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
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) {
|
||||
@Nullable UiccAccessRule[] accessRules, String cardId) {
|
||||
this.mId = id;
|
||||
this.mIccId = iccId;
|
||||
this.mSimSlotIndex = simSlotIndex;
|
||||
@@ -158,6 +175,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
this.mCountryIso = countryIso;
|
||||
this.mIsEmbedded = isEmbedded;
|
||||
this.mAccessRules = accessRules;
|
||||
this.mCardId = cardId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -387,6 +405,14 @@ public class SubscriptionInfo implements Parcelable {
|
||||
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>() {
|
||||
@Override
|
||||
public SubscriptionInfo createFromParcel(Parcel source) {
|
||||
@@ -405,10 +431,11 @@ public class SubscriptionInfo implements Parcelable {
|
||||
Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
|
||||
boolean isEmbedded = source.readBoolean();
|
||||
UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR);
|
||||
String cardId = source.readString();
|
||||
|
||||
return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName,
|
||||
nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso,
|
||||
isEmbedded, accessRules);
|
||||
isEmbedded, accessRules, cardId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -434,6 +461,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
mIconBitmap.writeToParcel(dest, flags);
|
||||
dest.writeBoolean(mIsEmbedded);
|
||||
dest.writeTypedArray(mAccessRules, flags);
|
||||
dest.writeString(mCardId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -459,11 +487,13 @@ public class SubscriptionInfo implements Parcelable {
|
||||
@Override
|
||||
public String toString() {
|
||||
String iccIdToPrint = givePrintableIccid(mIccId);
|
||||
String cardIdToPrint = givePrintableIccid(mCardId);
|
||||
return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
|
||||
+ " displayName=" + mDisplayName + " carrierName=" + mCarrierName
|
||||
+ " nameSource=" + mNameSource + " iconTint=" + mIconTint
|
||||
+ " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
|
||||
+ " mnc " + mMnc + " isEmbedded " + mIsEmbedded
|
||||
+ " accessRules " + Arrays.toString(mAccessRules) + "}";
|
||||
+ " accessRules " + Arrays.toString(mAccessRules)
|
||||
+ " cardId=" + cardIdToPrint + "}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +270,14 @@ public class SubscriptionManager {
|
||||
*/
|
||||
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
|
||||
* {@link UiccAccessRule#encodeRules}. Only present if {@link #IS_EMBEDDED} is 1.
|
||||
|
||||
Reference in New Issue
Block a user