add carrierid in subscriptionInfo
add carrierid in subscritionInfo so that apps can get subId, carrierid and other sim related info from a single call Bug: 119676543 Test: gts SubscriptionInfoTest Change-Id: Ia2d01ad6bd59565adbf989b4d95e7f64f3ee6d45
This commit is contained in:
committed by
Xiangyu/Malcolm Chen
parent
8bac1090ee
commit
0034bb393c
@@ -57,6 +57,7 @@ package android {
|
||||
field public static final java.lang.String BROADCAST_SMS = "android.permission.BROADCAST_SMS";
|
||||
field public static final java.lang.String BROADCAST_STICKY = "android.permission.BROADCAST_STICKY";
|
||||
field public static final java.lang.String BROADCAST_WAP_PUSH = "android.permission.BROADCAST_WAP_PUSH";
|
||||
field public static final java.lang.String CALL_COMPANION_APP = "android.permission.CALL_COMPANION_APP";
|
||||
field public static final java.lang.String CALL_PHONE = "android.permission.CALL_PHONE";
|
||||
field public static final java.lang.String CALL_PRIVILEGED = "android.permission.CALL_PRIVILEGED";
|
||||
field public static final java.lang.String CAMERA = "android.permission.CAMERA";
|
||||
@@ -91,7 +92,6 @@ package android {
|
||||
field public static final java.lang.String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE";
|
||||
field public static final java.lang.String MANAGE_DOCUMENTS = "android.permission.MANAGE_DOCUMENTS";
|
||||
field public static final java.lang.String MANAGE_OWN_CALLS = "android.permission.MANAGE_OWN_CALLS";
|
||||
field public static final java.lang.String CALL_COMPANION_APP = "android.permission.CALL_COMPANION_APP";
|
||||
field public static final java.lang.String MASTER_CLEAR = "android.permission.MASTER_CLEAR";
|
||||
field public static final java.lang.String MEDIA_CONTENT_CONTROL = "android.permission.MEDIA_CONTENT_CONTROL";
|
||||
field public static final java.lang.String MODIFY_AUDIO_SETTINGS = "android.permission.MODIFY_AUDIO_SETTINGS";
|
||||
@@ -43167,6 +43167,7 @@ package android.telecom {
|
||||
field public static final java.lang.String EXTRA_INCOMING_CALL_EXTRAS = "android.telecom.extra.INCOMING_CALL_EXTRAS";
|
||||
field public static final java.lang.String EXTRA_INCOMING_VIDEO_STATE = "android.telecom.extra.INCOMING_VIDEO_STATE";
|
||||
field public static final java.lang.String EXTRA_IS_DEFAULT_CALL_SCREENING_APP = "android.telecom.extra.IS_DEFAULT_CALL_SCREENING_APP";
|
||||
field public static final java.lang.String EXTRA_IS_ENABLED = "android.telecom.extra.IS_ENABLED";
|
||||
field public static final java.lang.String EXTRA_NOTIFICATION_COUNT = "android.telecom.extra.NOTIFICATION_COUNT";
|
||||
field public static final java.lang.String EXTRA_NOTIFICATION_PHONE_NUMBER = "android.telecom.extra.NOTIFICATION_PHONE_NUMBER";
|
||||
field public static final java.lang.String EXTRA_OUTGOING_CALL_EXTRAS = "android.telecom.extra.OUTGOING_CALL_EXTRAS";
|
||||
@@ -43174,14 +43175,13 @@ package android.telecom {
|
||||
field public static final java.lang.String EXTRA_START_CALL_WITH_RTT = "android.telecom.extra.START_CALL_WITH_RTT";
|
||||
field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.telecom.extra.START_CALL_WITH_SPEAKERPHONE";
|
||||
field public static final java.lang.String EXTRA_START_CALL_WITH_VIDEO_STATE = "android.telecom.extra.START_CALL_WITH_VIDEO_STATE";
|
||||
field public static final java.lang.String EXTRA_IS_ENABLED = "android.telecom.extra.IS_ENABLED";
|
||||
field public static final java.lang.String GATEWAY_ORIGINAL_ADDRESS = "android.telecom.extra.GATEWAY_ORIGINAL_ADDRESS";
|
||||
field public static final java.lang.String GATEWAY_PROVIDER_PACKAGE = "android.telecom.extra.GATEWAY_PROVIDER_PACKAGE";
|
||||
field public static final java.lang.String METADATA_INCLUDE_EXTERNAL_CALLS = "android.telecom.INCLUDE_EXTERNAL_CALLS";
|
||||
field public static final java.lang.String METADATA_INCLUDE_SELF_MANAGED_CALLS = "android.telecom.INCLUDE_SELF_MANAGED_CALLS";
|
||||
field public static final java.lang.String METADATA_IN_CALL_SERVICE_CAR_MODE_UI = "android.telecom.IN_CALL_SERVICE_CAR_MODE_UI";
|
||||
field public static final java.lang.String METADATA_IN_CALL_SERVICE_RINGING = "android.telecom.IN_CALL_SERVICE_RINGING";
|
||||
field public static final java.lang.String METADATA_IN_CALL_SERVICE_UI = "android.telecom.IN_CALL_SERVICE_UI";
|
||||
field public static final java.lang.String METADATA_IN_CALL_SERVICE_CAR_MODE_UI = "android.telecom.IN_CALL_SERVICE_CAR_MODE_UI";
|
||||
field public static final int PRESENTATION_ALLOWED = 1; // 0x1
|
||||
field public static final int PRESENTATION_PAYPHONE = 4; // 0x4
|
||||
field public static final int PRESENTATION_RESTRICTED = 2; // 0x2
|
||||
@@ -44128,6 +44128,7 @@ package android.telephony {
|
||||
public class SubscriptionInfo implements android.os.Parcelable {
|
||||
method public android.graphics.Bitmap createIconBitmap(android.content.Context);
|
||||
method public int describeContents();
|
||||
method public int getCarrierId();
|
||||
method public java.lang.CharSequence getCarrierName();
|
||||
method public java.lang.String getCountryIso();
|
||||
method public int getDataRoaming();
|
||||
|
||||
@@ -79,6 +79,12 @@ public class SubscriptionInfo implements Parcelable {
|
||||
*/
|
||||
private CharSequence mCarrierName;
|
||||
|
||||
/**
|
||||
* The subscription carrier id.
|
||||
* @see TelephonyManager#getSimCarrierId()
|
||||
*/
|
||||
private int mCarrierId;
|
||||
|
||||
/**
|
||||
* The source of the name, NAME_SOURCE_UNDEFINED, NAME_SOURCE_DEFAULT_SOURCE,
|
||||
* NAME_SOURCE_SIM_SOURCE or NAME_SOURCE_USER_INPUT.
|
||||
@@ -171,7 +177,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
@Nullable UiccAccessRule[] accessRules, String cardId) {
|
||||
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
||||
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardId,
|
||||
false, null, true);
|
||||
false, null, true, TelephonyManager.UNKNOWN_CARRIER_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,10 +187,10 @@ public class SubscriptionInfo implements Parcelable {
|
||||
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
||||
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
||||
@Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic,
|
||||
@Nullable String groupUUID, boolean isMetered) {
|
||||
@Nullable String groupUUID, boolean isMetered, int carrierId) {
|
||||
this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
|
||||
roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardId,
|
||||
isOpportunistic, groupUUID, isMetered, false);
|
||||
isOpportunistic, groupUUID, isMetered, false, carrierId);
|
||||
}
|
||||
/**
|
||||
* @hide
|
||||
@@ -193,7 +199,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
CharSequence carrierName, int nameSource, int iconTint, String number, int roaming,
|
||||
Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded,
|
||||
@Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic,
|
||||
@Nullable String groupUUID, boolean isMetered, boolean isGroupDisabled) {
|
||||
@Nullable String groupUUID, boolean isMetered, boolean isGroupDisabled, int carrierid) {
|
||||
this.mId = id;
|
||||
this.mIccId = iccId;
|
||||
this.mSimSlotIndex = simSlotIndex;
|
||||
@@ -214,6 +220,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
this.mGroupUUID = groupUUID;
|
||||
this.mIsMetered = isMetered;
|
||||
this.mIsGroupDisabled = isGroupDisabled;
|
||||
this.mCarrierId = carrierid;
|
||||
}
|
||||
|
||||
|
||||
@@ -238,6 +245,14 @@ public class SubscriptionInfo implements Parcelable {
|
||||
return this.mSimSlotIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the carrier id of this Subscription carrier.
|
||||
* @see TelephonyManager#getSimCarrierId()
|
||||
*/
|
||||
public int getCarrierId() {
|
||||
return this.mCarrierId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name displayed to the user that identifies this subscription
|
||||
*/
|
||||
@@ -554,11 +569,12 @@ public class SubscriptionInfo implements Parcelable {
|
||||
String groupUUID = source.readString();
|
||||
boolean isMetered = source.readBoolean();
|
||||
boolean isGroupDisabled = source.readBoolean();
|
||||
int carrierid = source.readInt();
|
||||
|
||||
return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName,
|
||||
nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso,
|
||||
isEmbedded, accessRules, cardId, isOpportunistic, groupUUID, isMetered,
|
||||
isGroupDisabled);
|
||||
isGroupDisabled, carrierid);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -589,6 +605,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
dest.writeString(mGroupUUID);
|
||||
dest.writeBoolean(mIsMetered);
|
||||
dest.writeBoolean(mIsGroupDisabled);
|
||||
dest.writeInt(mCarrierId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -616,8 +633,9 @@ public class SubscriptionInfo implements Parcelable {
|
||||
String iccIdToPrint = givePrintableIccid(mIccId);
|
||||
String cardIdToPrint = givePrintableIccid(mCardId);
|
||||
return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex
|
||||
+ " displayName=" + mDisplayName + " carrierName=" + mCarrierName
|
||||
+ " nameSource=" + mNameSource + " iconTint=" + mIconTint + " mNumber=" + mNumber
|
||||
+ " carrierId=" + mCarrierId + " displayName=" + mDisplayName
|
||||
+ " carrierName=" + mCarrierName + " nameSource=" + mNameSource
|
||||
+ " iconTint=" + mIconTint + " mNumber=" + mNumber
|
||||
+ " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc
|
||||
+ " mnc " + mMnc + "mCountryIso=" + mCountryIso + " isEmbedded " + mIsEmbedded
|
||||
+ " accessRules " + Arrays.toString(mAccessRules)
|
||||
@@ -630,7 +648,8 @@ public class SubscriptionInfo implements Parcelable {
|
||||
public int hashCode() {
|
||||
return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
|
||||
mIsOpportunistic, mGroupUUID, mIsMetered, mIccId, mNumber, mMcc, mMnc,
|
||||
mCountryIso, mCardId, mDisplayName, mCarrierName, mAccessRules, mIsGroupDisabled);
|
||||
mCountryIso, mCardId, mDisplayName, mCarrierName, mAccessRules, mIsGroupDisabled,
|
||||
mCarrierId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -653,8 +672,9 @@ public class SubscriptionInfo implements Parcelable {
|
||||
&& mIsEmbedded == toCompare.mIsEmbedded
|
||||
&& mIsOpportunistic == toCompare.mIsOpportunistic
|
||||
&& mIsGroupDisabled == toCompare.mIsGroupDisabled
|
||||
&& Objects.equals(mGroupUUID, toCompare.mGroupUUID)
|
||||
&& mCarrierId == toCompare.mCarrierId
|
||||
&& mIsMetered == toCompare.mIsMetered
|
||||
&& Objects.equals(mGroupUUID, toCompare.mGroupUUID)
|
||||
&& Objects.equals(mIccId, toCompare.mIccId)
|
||||
&& Objects.equals(mNumber, toCompare.mNumber)
|
||||
&& Objects.equals(mMcc, toCompare.mMcc)
|
||||
|
||||
@@ -381,6 +381,14 @@ public class SubscriptionManager {
|
||||
/** @hide */
|
||||
public static final int SIM_PROVISIONED = 0;
|
||||
|
||||
/**
|
||||
* TelephonyProvider column name for subscription carrier id.
|
||||
* @see TelephonyManager#getSimCarrierId()
|
||||
* <p>Type: INTEGER (int) </p>
|
||||
* @hide
|
||||
*/
|
||||
public static final String CARRIER_ID = "carrier_id";
|
||||
|
||||
/**
|
||||
* TelephonyProvider column name for the MCC associated with a SIM, stored as a string.
|
||||
* <P>Type: TEXT (String)</P>
|
||||
|
||||
Reference in New Issue
Block a user