Merge "Revert "Update SubscriptionInfo o use strings for mccmnc""
diff --git a/api/current.txt b/api/current.txt
index 707c7f8..9ffd50f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -40774,10 +40774,8 @@
method public java.lang.CharSequence getDisplayName();
method public java.lang.String getIccId();
method public int getIconTint();
- method public deprecated int getMcc();
- method public java.lang.String getMccString();
- method public deprecated int getMnc();
- method public java.lang.String getMncString();
+ method public int getMcc();
+ method public int getMnc();
method public java.lang.String getNumber();
method public int getSimSlotIndex();
method public int getSubscriptionId();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 9ca8284..d45a5ec 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -930,7 +930,7 @@
private SubscriptionInfo addSignalController(int id, int simSlotIndex) {
SubscriptionInfo info = new SubscriptionInfo(id, "", simSlotIndex, "", "", 0, 0, "", 0,
- null, null, null, "");
+ null, 0, 0, "");
MobileSignalController controller = new MobileSignalController(mContext,
mConfig, mHasMobileDataFeature, mPhone, mCallbackHandler, this, info,
mSubDefaults, mReceiverHandler.getLooper());
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java
index d76e39b..936505c 100644
--- a/telephony/java/android/telephony/SubscriptionInfo.java
+++ b/telephony/java/android/telephony/SubscriptionInfo.java
@@ -33,9 +33,9 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.util.DisplayMetrics;
-import android.util.Log;
import java.util.Arrays;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -105,12 +105,12 @@
/**
* Mobile Country Code
*/
- private String mMcc;
+ private int mMcc;
/**
* Mobile Network Code
*/
- private String mMnc;
+ private int mMnc;
/**
* ISO Country code for the subscription's provider
@@ -138,11 +138,11 @@
* @hide
*/
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
- CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
- Bitmap icon, String mcc, String mnc, String countryIso) {
+ 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 */);
+ roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */,
+ null /* accessRules */, null /* accessRules */);
}
/**
@@ -150,7 +150,7 @@
*/
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
- Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
+ 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, isEmbedded, accessRules, null /* cardId */);
@@ -161,7 +161,7 @@
*/
public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName,
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
- Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
+ Bitmap icon, int mcc, int mnc, String countryIso, boolean isEmbedded,
@Nullable UiccAccessRule[] accessRules, String cardId) {
this.mId = id;
this.mIccId = iccId;
@@ -316,43 +316,15 @@
/**
* @return the MCC.
- * @deprecated Use {@link #getMccString()} instead.
*/
- @Deprecated
public int getMcc() {
- try {
- return this.mMcc == null ? 0 : Integer.valueOf(this.mMcc);
- } catch (NumberFormatException e) {
- Log.w(SubscriptionInfo.class.getSimpleName(), "MCC string is not a number");
- return 0;
- }
- }
-
- /**
- * @return the MNC.
- * @deprecated Use {@link #getMncString()} instead.
- */
- @Deprecated
- public int getMnc() {
- try {
- return this.mMnc == null ? 0 : Integer.valueOf(this.mMnc);
- } catch (NumberFormatException e) {
- Log.w(SubscriptionInfo.class.getSimpleName(), "MNC string is not a number");
- return 0;
- }
- }
-
- /**
- * @return The MCC, as a string.
- */
- public String getMccString() {
return this.mMcc;
}
/**
- * @return The MNC, as a string.
+ * @return the MNC.
*/
- public String getMncString() {
+ public int getMnc() {
return this.mMnc;
}
@@ -453,8 +425,8 @@
int iconTint = source.readInt();
String number = source.readString();
int dataRoaming = source.readInt();
- String mcc = source.readString();
- String mnc = source.readString();
+ int mcc = source.readInt();
+ int mnc = source.readInt();
String countryIso = source.readString();
Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
boolean isEmbedded = source.readBoolean();
@@ -483,8 +455,8 @@
dest.writeInt(mIconTint);
dest.writeString(mNumber);
dest.writeInt(mDataRoaming);
- dest.writeString(mMcc);
- dest.writeString(mMnc);
+ dest.writeInt(mMcc);
+ dest.writeInt(mMnc);
dest.writeString(mCountryIso);
mIconBitmap.writeToParcel(dest, flags);
dest.writeBoolean(mIsEmbedded);
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 310d2bf..5a60aa6 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -243,20 +243,6 @@
public static final int SIM_PROVISIONED = 0;
/**
- * TelephonyProvider column name for the MCC associated with a SIM, stored as a string.
- * <P>Type: TEXT (String)</P>
- * @hide
- */
- public static final String MCC_STRING = "mcc_string";
-
- /**
- * TelephonyProvider column name for the MNC associated with a SIM, stored as a string.
- * <P>Type: TEXT (String)</P>
- * @hide
- */
- public static final String MNC_STRING = "mnc_string";
-
- /**
* TelephonyProvider column name for the MCC associated with a SIM.
* <P>Type: INTEGER (int)</P>
* @hide