diff options
author | Tom Taylor <tomtaylor@google.com> | 2014-09-04 14:05:20 -0700 |
---|---|---|
committer | Tom Taylor <tomtaylor@google.com> | 2014-09-04 14:05:20 -0700 |
commit | 7a96207e2ba549843e9fcbbc7f2fde7ed96ada84 (patch) | |
tree | 0cdab02594310583c828c106ac635738a46fe897 /telephony | |
parent | 9f30ce3b82acb1f9582e49e9d87ab0d58c8f9ce4 (diff) | |
download | frameworks_base-7a96207e2ba549843e9fcbbc7f2fde7ed96ada84.zip frameworks_base-7a96207e2ba549843e9fcbbc7f2fde7ed96ada84.tar.gz frameworks_base-7a96207e2ba549843e9fcbbc7f2fde7ed96ada84.tar.bz2 |
Add mcc/mnc to SubInfoRecord
Bug 17157686
Change-Id: I47d19dea73f038a8d748f95dd33452da62ebf26b
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/SubInfoRecord.java | 43 | ||||
-rw-r--r-- | telephony/java/android/telephony/SubscriptionManager.java | 14 |
2 files changed, 41 insertions, 16 deletions
diff --git a/telephony/java/android/telephony/SubInfoRecord.java b/telephony/java/android/telephony/SubInfoRecord.java index 55781fa..3a47269 100644 --- a/telephony/java/android/telephony/SubInfoRecord.java +++ b/telephony/java/android/telephony/SubInfoRecord.java @@ -36,6 +36,8 @@ public class SubInfoRecord implements Parcelable { public int mDisplayNumberFormat; public int mDataRoaming; public int[] mSimIconRes; + public int mMcc; + public int mMnc; public SubInfoRecord() { this.mSubId = SubscriptionManager.INVALID_SUB_ID; @@ -48,38 +50,45 @@ public class SubInfoRecord implements Parcelable { this.mDisplayNumberFormat = 0; this.mDataRoaming = 0; this.mSimIconRes = new int[2]; + this.mMcc = 0; + this.mMnc = 0; } - public SubInfoRecord(long subId, String iccId, int slotId, String displayName, - int nameSource, int mColor, String mNumber, int displayFormat, int roaming, int[] iconRes) { + public SubInfoRecord(long subId, String iccId, int slotId, String displayName, int nameSource, + int color, String number, int displayFormat, int roaming, int[] iconRes, + int mcc, int mnc) { this.mSubId = subId; this.mIccId = iccId; this.mSlotId = slotId; this.mDisplayName = displayName; this.mNameSource = nameSource; - this.mColor = mColor; - this.mNumber = mNumber; + this.mColor = color; + this.mNumber = number; this.mDisplayNumberFormat = displayFormat; this.mDataRoaming = roaming; this.mSimIconRes = iconRes; + this.mMcc = mcc; + this.mMnc = mnc; } public static final Parcelable.Creator<SubInfoRecord> CREATOR = new Parcelable.Creator<SubInfoRecord>() { public SubInfoRecord createFromParcel(Parcel source) { - long mSubId = source.readLong(); - String mIccId = source.readString(); - int mSlotId = source.readInt(); - String mDisplayName = source.readString(); - int mNameSource = source.readInt(); - int mColor = source.readInt(); - String mNumber = source.readString(); - int mDisplayNumberFormat = source.readInt(); - int mDataRoaming = source.readInt(); + long subId = source.readLong(); + String iccId = source.readString(); + int slotId = source.readInt(); + String displayName = source.readString(); + int nameSource = source.readInt(); + int color = source.readInt(); + String number = source.readString(); + int displayNumberFormat = source.readInt(); + int dataRoaming = source.readInt(); int[] iconRes = new int[2]; source.readIntArray(iconRes); + int mcc = source.readInt(); + int mnc = source.readInt(); - return new SubInfoRecord(mSubId, mIccId, mSlotId, mDisplayName, mNameSource, mColor, mNumber, - mDisplayNumberFormat, mDataRoaming, iconRes); + return new SubInfoRecord(subId, iccId, slotId, displayName, nameSource, color, number, + displayNumberFormat, dataRoaming, iconRes, mcc, mnc); } public SubInfoRecord[] newArray(int size) { @@ -98,6 +107,8 @@ public class SubInfoRecord implements Parcelable { dest.writeInt(mDisplayNumberFormat); dest.writeInt(mDataRoaming); dest.writeIntArray(mSimIconRes); + dest.writeInt(mMcc); + dest.writeInt(mMnc); } public int describeContents() { @@ -109,6 +120,6 @@ public class SubInfoRecord implements Parcelable { + " mDisplayName=" + mDisplayName + " mNameSource=" + mNameSource + " mColor=" + mColor + " mNumber=" + mNumber + " mDisplayNumberFormat=" + mDisplayNumberFormat + " mDataRoaming=" + mDataRoaming - + " mSimIconRes=" + mSimIconRes + "}"; + + " mSimIconRes=" + mSimIconRes + " mMcc " + mMcc + " mMnc " + mMnc + "}"; } } diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 2bb2404..b5f8847 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -27,6 +27,7 @@ import android.os.RemoteException; import com.android.internal.telephony.ISub; import com.android.internal.telephony.PhoneConstants; + import java.util.List; /** @@ -204,6 +205,19 @@ public class SubscriptionManager implements BaseColumns { /** @hide */ public static final int DATA_ROAMING_DEFAULT = DATA_ROAMING_DISABLE; + /** + * The MCC associated with a SIM. + * <P>Type: INTEGER (int)</P> + */ + public static final String MCC = "mcc"; + + /** + * The MNC associated with a SIM. + * <P>Type: INTEGER (int)</P> + */ + public static final String MNC = "mnc"; + + private static final int RES_TYPE_BACKGROUND_DARK = 0; private static final int RES_TYPE_BACKGROUND_LIGHT = 1; |