summaryrefslogtreecommitdiff
path: root/telephony/java/android/service
diff options
context:
space:
mode:
Diffstat (limited to 'telephony/java/android/service')
-rw-r--r--telephony/java/android/service/carrier/CarrierIdentifier.java33
1 files changed, 31 insertions, 2 deletions
diff --git a/telephony/java/android/service/carrier/CarrierIdentifier.java b/telephony/java/android/service/carrier/CarrierIdentifier.java
index bc0f909e1331..c6b9ea200382 100644
--- a/telephony/java/android/service/carrier/CarrierIdentifier.java
+++ b/telephony/java/android/service/carrier/CarrierIdentifier.java
@@ -55,12 +55,13 @@ public class CarrierIdentifier implements Parcelable {
private @Nullable String mImsi;
private @Nullable String mGid1;
private @Nullable String mGid2;
+ private @Nullable String mIccid;
private int mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
private int mSpecificCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
public CarrierIdentifier(String mcc, String mnc, @Nullable String spn, @Nullable String imsi,
@Nullable String gid1, @Nullable String gid2) {
- this(mcc, mnc, spn, imsi, gid1, gid2, TelephonyManager.UNKNOWN_CARRIER_ID,
+ this(mcc, mnc, spn, imsi, gid1, gid2, null, TelephonyManager.UNKNOWN_CARRIER_ID,
TelephonyManager.UNKNOWN_CARRIER_ID);
}
@@ -79,16 +80,31 @@ public class CarrierIdentifier implements Parcelable {
public CarrierIdentifier(@NonNull String mcc, @NonNull String mnc, @Nullable String spn,
@Nullable String imsi, @Nullable String gid1, @Nullable String gid2,
int carrierid, int specificCarrierId) {
+ this(mcc, mnc, spn, imsi, gid1, gid2, null, carrierid, specificCarrierId);
+ }
+
+ /** @hide */
+ public CarrierIdentifier(String mcc, String mnc, @Nullable String spn,
+ @Nullable String imsi, @Nullable String gid1, @Nullable String gid2,
+ @Nullable String iccid, int carrierid, int specificCarrierId) {
mMcc = mcc;
mMnc = mnc;
mSpn = spn;
mImsi = imsi;
mGid1 = gid1;
mGid2 = gid2;
+ mIccid = iccid;
mCarrierId = carrierid;
mSpecificCarrierId = specificCarrierId;
}
+ /** @hide */
+ public CarrierIdentifier(String mcc, String mnc, @Nullable String spn, @Nullable String imsi,
+ @Nullable String gid1, @Nullable String gid2I, @Nullable String iccid) {
+ this(mcc, mnc, spn, imsi, gid1, gid2I);
+ mIccid = iccid;
+ }
+
/**
* Creates a carrier identifier instance.
*
@@ -113,6 +129,7 @@ public class CarrierIdentifier implements Parcelable {
mGid2 = gid2;
mSpn = null;
mImsi = null;
+ mIccid = null;
}
/** @hide */
@@ -154,6 +171,13 @@ public class CarrierIdentifier implements Parcelable {
return mGid2;
}
+ /** Get the ICCID.
+ * @hide */
+ @Nullable
+ public String getIccid() {
+ return mIccid;
+ }
+
/**
* Returns the carrier id.
* @see TelephonyManager#getSimCarrierId()
@@ -192,13 +216,14 @@ public class CarrierIdentifier implements Parcelable {
&& Objects.equals(mImsi, that.mImsi)
&& Objects.equals(mGid1, that.mGid1)
&& Objects.equals(mGid2, that.mGid2)
+ && Objects.equals(mIccid, that.mIccid)
&& Objects.equals(mCarrierId, that.mCarrierId)
&& Objects.equals(mSpecificCarrierId, that.mSpecificCarrierId);
}
@Override
public int hashCode(){
- return Objects.hash(mMcc, mMnc, mSpn, mImsi, mGid1, mGid2, mCarrierId, mSpecificCarrierId);
+ return Objects.hash(mMcc, mMnc, mSpn, mImsi, mGid1, mGid2, mIccid, mCarrierId, mSpecificCarrierId);
}
@Override
@@ -214,6 +239,7 @@ public class CarrierIdentifier implements Parcelable {
out.writeString(mImsi);
out.writeString(mGid1);
out.writeString(mGid2);
+ out.writeString(mIccid);
out.writeInt(mCarrierId);
out.writeInt(mSpecificCarrierId);
}
@@ -227,6 +253,7 @@ public class CarrierIdentifier implements Parcelable {
+ ",imsi=" + Rlog.pii(false, mImsi)
+ ",gid1=" + mGid1
+ ",gid2=" + mGid2
+ + ",iccid=" + mIccid
+ ",carrierid=" + mCarrierId
+ ",specificCarrierId=" + mSpecificCarrierId
+ "}";
@@ -240,6 +267,7 @@ public class CarrierIdentifier implements Parcelable {
mImsi = in.readString();
mGid1 = in.readString();
mGid2 = in.readString();
+ mIccid = in.readString();
mCarrierId = in.readInt();
mSpecificCarrierId = in.readInt();
}
@@ -251,5 +279,6 @@ public class CarrierIdentifier implements Parcelable {
int IMSI_PREFIX = 2;
int GID1 = 3;
int GID2 = 4;
+ int ICCID = 5;
}
}