Merge "Update SubscriptionInfo o use strings for mccmnc"
This commit is contained in:
@@ -40774,8 +40774,10 @@ package android.telephony {
|
|||||||
method public java.lang.CharSequence getDisplayName();
|
method public java.lang.CharSequence getDisplayName();
|
||||||
method public java.lang.String getIccId();
|
method public java.lang.String getIccId();
|
||||||
method public int getIconTint();
|
method public int getIconTint();
|
||||||
method public int getMcc();
|
method public deprecated int getMcc();
|
||||||
method public int getMnc();
|
method public java.lang.String getMccString();
|
||||||
|
method public deprecated int getMnc();
|
||||||
|
method public java.lang.String getMncString();
|
||||||
method public java.lang.String getNumber();
|
method public java.lang.String getNumber();
|
||||||
method public int getSimSlotIndex();
|
method public int getSimSlotIndex();
|
||||||
method public int getSubscriptionId();
|
method public int getSubscriptionId();
|
||||||
|
|||||||
@@ -930,7 +930,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
|
|||||||
|
|
||||||
private SubscriptionInfo addSignalController(int id, int simSlotIndex) {
|
private SubscriptionInfo addSignalController(int id, int simSlotIndex) {
|
||||||
SubscriptionInfo info = new SubscriptionInfo(id, "", simSlotIndex, "", "", 0, 0, "", 0,
|
SubscriptionInfo info = new SubscriptionInfo(id, "", simSlotIndex, "", "", 0, 0, "", 0,
|
||||||
null, 0, 0, "");
|
null, null, null, "");
|
||||||
MobileSignalController controller = new MobileSignalController(mContext,
|
MobileSignalController controller = new MobileSignalController(mContext,
|
||||||
mConfig, mHasMobileDataFeature, mPhone, mCallbackHandler, this, info,
|
mConfig, mHasMobileDataFeature, mPhone, mCallbackHandler, this, info,
|
||||||
mSubDefaults, mReceiverHandler.getLooper());
|
mSubDefaults, mReceiverHandler.getLooper());
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ import android.os.Build;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,12 +105,12 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* Mobile Country Code
|
* Mobile Country Code
|
||||||
*/
|
*/
|
||||||
private int mMcc;
|
private String mMcc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mobile Network Code
|
* Mobile Network Code
|
||||||
*/
|
*/
|
||||||
private int mMnc;
|
private String mMnc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ISO Country code for the subscription's provider
|
* ISO Country code for the subscription's provider
|
||||||
@@ -138,11 +138,11 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
* @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, int mcc, int mnc, String countryIso) {
|
Bitmap icon, String mcc, String mnc, String countryIso) {
|
||||||
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
||||||
roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */,
|
roaming, icon, mcc, mnc, countryIso, false /* isEmbedded */,
|
||||||
null /* accessRules */, null /* accessRules */);
|
null /* accessRules */, null /* accessRules */);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,7 +150,7 @@ 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, int mcc, int mnc, String countryIso, boolean isEmbedded,
|
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
||||||
@Nullable UiccAccessRule[] accessRules) {
|
@Nullable UiccAccessRule[] accessRules) {
|
||||||
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, null /* cardId */);
|
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,
|
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, int mcc, int mnc, String countryIso, boolean isEmbedded,
|
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
||||||
@Nullable UiccAccessRule[] accessRules, String cardId) {
|
@Nullable UiccAccessRule[] accessRules, String cardId) {
|
||||||
this.mId = id;
|
this.mId = id;
|
||||||
this.mIccId = iccId;
|
this.mIccId = iccId;
|
||||||
@@ -316,15 +316,43 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the MCC.
|
* @return the MCC.
|
||||||
|
* @deprecated Use {@link #getMccString()} instead.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public int getMcc() {
|
public int getMcc() {
|
||||||
return this.mMcc;
|
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.
|
* @return the MNC.
|
||||||
|
* @deprecated Use {@link #getMncString()} instead.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public int getMnc() {
|
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.
|
||||||
|
*/
|
||||||
|
public String getMncString() {
|
||||||
return this.mMnc;
|
return this.mMnc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,8 +453,8 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
int iconTint = source.readInt();
|
int iconTint = source.readInt();
|
||||||
String number = source.readString();
|
String number = source.readString();
|
||||||
int dataRoaming = source.readInt();
|
int dataRoaming = source.readInt();
|
||||||
int mcc = source.readInt();
|
String mcc = source.readString();
|
||||||
int mnc = source.readInt();
|
String mnc = source.readString();
|
||||||
String countryIso = source.readString();
|
String countryIso = source.readString();
|
||||||
Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
|
Bitmap iconBitmap = Bitmap.CREATOR.createFromParcel(source);
|
||||||
boolean isEmbedded = source.readBoolean();
|
boolean isEmbedded = source.readBoolean();
|
||||||
@@ -455,8 +483,8 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
dest.writeInt(mIconTint);
|
dest.writeInt(mIconTint);
|
||||||
dest.writeString(mNumber);
|
dest.writeString(mNumber);
|
||||||
dest.writeInt(mDataRoaming);
|
dest.writeInt(mDataRoaming);
|
||||||
dest.writeInt(mMcc);
|
dest.writeString(mMcc);
|
||||||
dest.writeInt(mMnc);
|
dest.writeString(mMnc);
|
||||||
dest.writeString(mCountryIso);
|
dest.writeString(mCountryIso);
|
||||||
mIconBitmap.writeToParcel(dest, flags);
|
mIconBitmap.writeToParcel(dest, flags);
|
||||||
dest.writeBoolean(mIsEmbedded);
|
dest.writeBoolean(mIsEmbedded);
|
||||||
|
|||||||
@@ -242,6 +242,20 @@ public class SubscriptionManager {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
public static final int SIM_PROVISIONED = 0;
|
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.
|
* TelephonyProvider column name for the MCC associated with a SIM.
|
||||||
* <P>Type: INTEGER (int)</P>
|
* <P>Type: INTEGER (int)</P>
|
||||||
|
|||||||
Reference in New Issue
Block a user