Merge "Revert "Update SubscriptionInfo o use strings for mccmnc""
This commit is contained in:
@@ -40774,10 +40774,8 @@ package android.telephony {
|
||||
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();
|
||||
|
||||
@@ -930,7 +930,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
|
||||
|
||||
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());
|
||||
|
||||
@@ -33,9 +33,9 @@ import android.os.Build;
|
||||
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 @@ public class SubscriptionInfo implements Parcelable {
|
||||
/**
|
||||
* 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 @@ public class SubscriptionInfo implements Parcelable {
|
||||
* @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 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, 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 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, 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 @@ public class SubscriptionInfo implements Parcelable {
|
||||
|
||||
/**
|
||||
* @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 @@ public class SubscriptionInfo implements Parcelable {
|
||||
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 @@ public class SubscriptionInfo implements Parcelable {
|
||||
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);
|
||||
|
||||
@@ -242,20 +242,6 @@ public class SubscriptionManager {
|
||||
/** @hide */
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user