Merge "SubscriptionInfo contains int cardId" am: 97c9aba888
am: 212e2576e1
Change-Id: I5bee233bf3603a11f7da8b04a51919da838cb130
This commit is contained in:
@@ -5391,6 +5391,7 @@ package android.telephony {
|
|||||||
|
|
||||||
public class SubscriptionInfo implements android.os.Parcelable {
|
public class SubscriptionInfo implements android.os.Parcelable {
|
||||||
method public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
|
method public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
|
||||||
|
method public int getCardId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SubscriptionManager {
|
public class SubscriptionManager {
|
||||||
|
|||||||
@@ -138,10 +138,15 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
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
|
* The string ID of the SIM card. It is the ICCID of the active profile for a UICC card and the
|
||||||
* for an eUICC card.
|
* EID for an eUICC card.
|
||||||
*/
|
*/
|
||||||
private String mCardId;
|
private String mCardString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The card ID of the SIM card. This maps uniquely to the card string.
|
||||||
|
*/
|
||||||
|
private int mCardId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the subscription is opportunistic.
|
* Whether the subscription is opportunistic.
|
||||||
@@ -174,9 +179,9 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
|
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
|
||||||
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
||||||
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
||||||
@Nullable UiccAccessRule[] accessRules, String cardId) {
|
@Nullable UiccAccessRule[] accessRules, String cardString) {
|
||||||
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
||||||
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardId,
|
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString,
|
||||||
false, null, true, TelephonyManager.UNKNOWN_CARRIER_ID);
|
false, null, true, TelephonyManager.UNKNOWN_CARRIER_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,20 +191,22 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
|
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
|
||||||
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
||||||
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
||||||
@Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic,
|
@Nullable UiccAccessRule[] accessRules, String cardString, boolean isOpportunistic,
|
||||||
@Nullable String groupUUID, boolean isMetered, int carrierId) {
|
@Nullable String groupUUID, boolean isMetered, int carrierId) {
|
||||||
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
||||||
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardId,
|
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardString, -1,
|
||||||
isOpportunistic, groupUUID, isMetered, false, carrierId);
|
isOpportunistic, groupUUID, isMetered, false, carrierId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
|
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
|
||||||
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
||||||
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
||||||
@Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic,
|
@Nullable UiccAccessRule[] accessRules, String cardString, int cardId,
|
||||||
@Nullable String groupUUID, boolean isMetered, boolean isGroupDisabled, int carrierid) {
|
boolean isOpportunistic, @Nullable String groupUUID, boolean isMetered,
|
||||||
|
boolean isGroupDisabled, int carrierid) {
|
||||||
this.mId = id;
|
this.mId = id;
|
||||||
this.mIccId = iccId;
|
this.mIccId = iccId;
|
||||||
this.mSimSlotIndex = simSlotIndex;
|
this.mSimSlotIndex = simSlotIndex;
|
||||||
@@ -215,6 +222,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.mCardString = cardString;
|
||||||
this.mCardId = cardId;
|
this.mCardId = cardId;
|
||||||
this.mIsOpportunistic = isOpportunistic;
|
this.mIsOpportunistic = isOpportunistic;
|
||||||
this.mGroupUUID = groupUUID;
|
this.mGroupUUID = groupUUID;
|
||||||
@@ -523,10 +531,20 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the ID of the SIM card which contains the subscription.
|
* @return the card string of the SIM card which contains the subscription. The card string is
|
||||||
|
* the ICCID for UICCs or the EID for eUICCs.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public String getCardId() {
|
public String getCardString() {
|
||||||
|
return this.mCardString;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the cardId of the SIM card which contains the subscription.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public int getCardId() {
|
||||||
return this.mCardId;
|
return this.mCardId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,7 +582,8 @@ 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();
|
String cardString = source.readString();
|
||||||
|
int cardId = source.readInt();
|
||||||
boolean isOpportunistic = source.readBoolean();
|
boolean isOpportunistic = source.readBoolean();
|
||||||
String groupUUID = source.readString();
|
String groupUUID = source.readString();
|
||||||
boolean isMetered = source.readBoolean();
|
boolean isMetered = source.readBoolean();
|
||||||
@@ -573,8 +592,8 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
|
|
||||||
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, cardId, isOpportunistic, groupUUID, isMetered,
|
isEmbedded, accessRules, cardString, cardId, isOpportunistic, groupUUID,
|
||||||
isGroupDisabled, carrierid);
|
isMetered, isGroupDisabled, carrierid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -600,7 +619,8 @@ 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);
|
dest.writeString(mCardString);
|
||||||
|
dest.writeInt(mCardId);
|
||||||
dest.writeBoolean(mIsOpportunistic);
|
dest.writeBoolean(mIsOpportunistic);
|
||||||
dest.writeString(mGroupUUID);
|
dest.writeString(mGroupUUID);
|
||||||
dest.writeBoolean(mIsMetered);
|
dest.writeBoolean(mIsMetered);
|
||||||
@@ -631,7 +651,7 @@ 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);
|
String cardStringToPrint = givePrintableIccid(mCardString);
|
||||||
return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
|
return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
|
||||||
+ " carrierId=" + mCarrierId + " displayName=" + mDisplayName
|
+ " carrierId=" + mCarrierId + " displayName=" + mDisplayName
|
||||||
+ " carrierName=" + mCarrierName + " nameSource=" + mNameSource
|
+ " carrierName=" + mCarrierName + " nameSource=" + mNameSource
|
||||||
@@ -639,17 +659,17 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
+ " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
|
+ " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
|
||||||
+ " mnc " + mMnc + "mCountryIso=" + mCountryIso + " isEmbedded " + mIsEmbedded
|
+ " mnc " + mMnc + "mCountryIso=" + mCountryIso + " isEmbedded " + mIsEmbedded
|
||||||
+ " accessRules " + Arrays.toString(mAccessRules)
|
+ " accessRules " + Arrays.toString(mAccessRules)
|
||||||
+ " cardId=" + cardIdToPrint + " isOpportunistic " + mIsOpportunistic
|
+ " cardString=" + cardStringToPrint + " cardId=" + mCardId
|
||||||
+ " mGroupUUID=" + mGroupUUID + " isMetered=" + mIsMetered
|
+ " isOpportunistic " + mIsOpportunistic + " mGroupUUID=" + mGroupUUID
|
||||||
+ " mIsGroupDisabled=" + mIsGroupDisabled + "}";
|
+ " isMetered=" + mIsMetered + " mIsGroupDisabled=" + mIsGroupDisabled + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
|
return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
|
||||||
mIsOpportunistic, mGroupUUID, mIsMetered, mIccId, mNumber, mMcc, mMnc,
|
mIsOpportunistic, mGroupUUID, mIsMetered, mIccId, mNumber, mMcc, mMnc,
|
||||||
mCountryIso, mCardId, mDisplayName, mCarrierName, mAccessRules, mIsGroupDisabled,
|
mCountryIso, mCardString, mCardId, mDisplayName, mCarrierName, mAccessRules,
|
||||||
mCarrierId);
|
mIsGroupDisabled, mCarrierId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -680,6 +700,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
&& Objects.equals(mMcc, toCompare.mMcc)
|
&& Objects.equals(mMcc, toCompare.mMcc)
|
||||||
&& Objects.equals(mMnc, toCompare.mMnc)
|
&& Objects.equals(mMnc, toCompare.mMnc)
|
||||||
&& Objects.equals(mCountryIso, toCompare.mCountryIso)
|
&& Objects.equals(mCountryIso, toCompare.mCountryIso)
|
||||||
|
&& Objects.equals(mCardString, toCompare.mCardString)
|
||||||
&& Objects.equals(mCardId, toCompare.mCardId)
|
&& Objects.equals(mCardId, toCompare.mCardId)
|
||||||
&& TextUtils.equals(mDisplayName, toCompare.mDisplayName)
|
&& TextUtils.equals(mDisplayName, toCompare.mDisplayName)
|
||||||
&& TextUtils.equals(mCarrierName, toCompare.mCarrierName)
|
&& TextUtils.equals(mCarrierName, toCompare.mCarrierName)
|
||||||
|
|||||||
Reference in New Issue
Block a user