Merge "rename precise carrier id to specific carrier id" am: 118354f77c

am: ab85849ce7

Change-Id: Icb53a9998d1f93852aadbee36a0f61322d8962b3
This commit is contained in:
Chen Xu
2019-03-11 15:33:16 -07:00
committed by android-build-merger
6 changed files with 113 additions and 89 deletions

View File

@@ -37319,13 +37319,13 @@ package android.provider {
} }
public static final class Telephony.CarrierId implements android.provider.BaseColumns { public static final class Telephony.CarrierId implements android.provider.BaseColumns {
method @NonNull public static android.net.Uri getPreciseCarrierIdUriForSubscriptionId(int); method @NonNull public static android.net.Uri getSpecificCarrierIdUriForSubscriptionId(int);
method public static android.net.Uri getUriForSubscriptionId(int); method public static android.net.Uri getUriForSubscriptionId(int);
field public static final String CARRIER_ID = "carrier_id"; field public static final String CARRIER_ID = "carrier_id";
field public static final String CARRIER_NAME = "carrier_name"; field public static final String CARRIER_NAME = "carrier_name";
field public static final android.net.Uri CONTENT_URI; field public static final android.net.Uri CONTENT_URI;
field public static final String PRECISE_CARRIER_ID = "precise_carrier_id"; field public static final String SPECIFIC_CARRIER_ID = "specific_carrier_id";
field public static final String PRECISE_CARRIER_ID_NAME = "precise_carrier_id_name"; field public static final String SPECIFIC_CARRIER_ID_NAME = "specific_carrier_id_name";
} }
public static final class Telephony.Carriers implements android.provider.BaseColumns { public static final class Telephony.Carriers implements android.provider.BaseColumns {
@@ -39447,7 +39447,7 @@ package android.service.carrier {
method @Nullable public String getImsi(); method @Nullable public String getImsi();
method public String getMcc(); method public String getMcc();
method public String getMnc(); method public String getMnc();
method public int getPreciseCarrierId(); method public int getSpecificCarrierId();
method @Nullable public String getSpn(); method @Nullable public String getSpn();
method public void writeToParcel(android.os.Parcel, int); method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.service.carrier.CarrierIdentifier> CREATOR; field public static final android.os.Parcelable.Creator<android.service.carrier.CarrierIdentifier> CREATOR;
@@ -43067,9 +43067,9 @@ package android.telephony {
method public String getSimCountryIso(); method public String getSimCountryIso();
method public String getSimOperator(); method public String getSimOperator();
method public String getSimOperatorName(); method public String getSimOperatorName();
method public int getSimPreciseCarrierId();
method @Nullable public CharSequence getSimPreciseCarrierIdName();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSimSerialNumber(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSimSerialNumber();
method public int getSimSpecificCarrierId();
method @Nullable public CharSequence getSimSpecificCarrierIdName();
method public int getSimState(); method public int getSimState();
method public int getSimState(int); method public int getSimState(int);
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSubscriberId(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSubscriberId();
@@ -43129,7 +43129,7 @@ package android.telephony {
field public static final String ACTION_SECRET_CODE = "android.telephony.action.SECRET_CODE"; field public static final String ACTION_SECRET_CODE = "android.telephony.action.SECRET_CODE";
field public static final String ACTION_SHOW_VOICEMAIL_NOTIFICATION = "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION"; field public static final String ACTION_SHOW_VOICEMAIL_NOTIFICATION = "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION";
field public static final String ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED = "android.telephony.action.SUBSCRIPTION_CARRIER_IDENTITY_CHANGED"; field public static final String ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED = "android.telephony.action.SUBSCRIPTION_CARRIER_IDENTITY_CHANGED";
field public static final String ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED = "android.telephony.action.SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED"; field public static final String ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED = "android.telephony.action.SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED";
field public static final int APPTYPE_CSIM = 4; // 0x4 field public static final int APPTYPE_CSIM = 4; // 0x4
field public static final int APPTYPE_ISIM = 5; // 0x5 field public static final int APPTYPE_ISIM = 5; // 0x5
field public static final int APPTYPE_RUIM = 3; // 0x3 field public static final int APPTYPE_RUIM = 3; // 0x3
@@ -43164,8 +43164,8 @@ package android.telephony {
field public static final String EXTRA_NETWORK_COUNTRY = "android.telephony.extra.NETWORK_COUNTRY"; field public static final String EXTRA_NETWORK_COUNTRY = "android.telephony.extra.NETWORK_COUNTRY";
field public static final String EXTRA_NOTIFICATION_COUNT = "android.telephony.extra.NOTIFICATION_COUNT"; field public static final String EXTRA_NOTIFICATION_COUNT = "android.telephony.extra.NOTIFICATION_COUNT";
field public static final String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telephony.extra.PHONE_ACCOUNT_HANDLE"; field public static final String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telephony.extra.PHONE_ACCOUNT_HANDLE";
field public static final String EXTRA_PRECISE_CARRIER_ID = "android.telephony.extra.PRECISE_CARRIER_ID"; field public static final String EXTRA_SPECIFIC_CARRIER_ID = "android.telephony.extra.SPECIFIC_CARRIER_ID";
field public static final String EXTRA_PRECISE_CARRIER_NAME = "android.telephony.extra.PRECISE_CARRIER_NAME"; field public static final String EXTRA_SPECIFIC_CARRIER_NAME = "android.telephony.extra.SPECIFIC_CARRIER_NAME";
field public static final String EXTRA_STATE = "state"; field public static final String EXTRA_STATE = "state";
field public static final String EXTRA_STATE_IDLE; field public static final String EXTRA_STATE_IDLE;
field public static final String EXTRA_STATE_OFFHOOK; field public static final String EXTRA_STATE_OFFHOOK;

View File

@@ -55,7 +55,7 @@ public class CarrierIdentifier implements Parcelable {
private @Nullable String mGid1; private @Nullable String mGid1;
private @Nullable String mGid2; private @Nullable String mGid2;
private int mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID; private int mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
private int mPreciseCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID; private int mSpecificCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
public CarrierIdentifier(String mcc, String mnc, @Nullable String spn, @Nullable String imsi, public CarrierIdentifier(String mcc, String mnc, @Nullable String spn, @Nullable String imsi,
@Nullable String gid1, @Nullable String gid2) { @Nullable String gid1, @Nullable String gid2) {
@@ -72,12 +72,12 @@ public class CarrierIdentifier implements Parcelable {
* @param gid2 group id level 2 * @param gid2 group id level 2
* @param carrierid carrier unique identifier {@link TelephonyManager#getSimCarrierId()}, used * @param carrierid carrier unique identifier {@link TelephonyManager#getSimCarrierId()}, used
* to uniquely identify the carrier and look up the carrier configurations. * to uniquely identify the carrier and look up the carrier configurations.
* @param preciseCarrierId precise carrier identifier * @param specificCarrierId specific carrier identifier
* {@link TelephonyManager#getSimPreciseCarrierId()} * {@link TelephonyManager#getSimSpecificCarrierId()}
*/ */
public CarrierIdentifier(@NonNull String mcc, @NonNull String mnc, @Nullable String spn, public CarrierIdentifier(@NonNull String mcc, @NonNull String mnc, @Nullable String spn,
@Nullable String imsi, @Nullable String gid1, @Nullable String gid2, @Nullable String imsi, @Nullable String gid1, @Nullable String gid2,
int carrierid, int preciseCarrierId) { int carrierid, int specificCarrierId) {
mMcc = mcc; mMcc = mcc;
mMnc = mnc; mMnc = mnc;
mSpn = spn; mSpn = spn;
@@ -85,7 +85,7 @@ public class CarrierIdentifier implements Parcelable {
mGid1 = gid1; mGid1 = gid1;
mGid2 = gid2; mGid2 = gid2;
mCarrierId = carrierid; mCarrierId = carrierid;
mPreciseCarrierId = preciseCarrierId; mSpecificCarrierId = specificCarrierId;
} }
/** /**
@@ -162,11 +162,17 @@ public class CarrierIdentifier implements Parcelable {
} }
/** /**
* Returns the precise carrier id. * A specific carrier ID returns the fine-grained carrier ID of the current subscription.
* @see TelephonyManager#getSimPreciseCarrierId() * It can represent the fact that a carrier may be in effect an aggregation of other carriers
* (ie in an MVNO type scenario) where each of these specific carriers which are used to make
* up the actual carrier service may have different carrier configurations.
* A specific carrier ID could also be used, for example, in a scenario where a carrier requires
* different carrier configuration for different service offering such as a prepaid plan.
*
* @see TelephonyManager#getSimSpecificCarrierId()
*/ */
public int getPreciseCarrierId() { public int getSpecificCarrierId() {
return mPreciseCarrierId; return mSpecificCarrierId;
} }
@Override @Override
@@ -186,12 +192,12 @@ public class CarrierIdentifier implements Parcelable {
&& Objects.equals(mGid1, that.mGid1) && Objects.equals(mGid1, that.mGid1)
&& Objects.equals(mGid2, that.mGid2) && Objects.equals(mGid2, that.mGid2)
&& Objects.equals(mCarrierId, that.mCarrierId) && Objects.equals(mCarrierId, that.mCarrierId)
&& Objects.equals(mPreciseCarrierId, that.mPreciseCarrierId); && Objects.equals(mSpecificCarrierId, that.mSpecificCarrierId);
} }
@Override @Override
public int hashCode(){ public int hashCode(){
return Objects.hash(mMcc, mMnc, mSpn, mImsi, mGid1, mGid2, mCarrierId, mPreciseCarrierId); return Objects.hash(mMcc, mMnc, mSpn, mImsi, mGid1, mGid2, mCarrierId, mSpecificCarrierId);
} }
@Override @Override
@@ -208,7 +214,7 @@ public class CarrierIdentifier implements Parcelable {
out.writeString(mGid1); out.writeString(mGid1);
out.writeString(mGid2); out.writeString(mGid2);
out.writeInt(mCarrierId); out.writeInt(mCarrierId);
out.writeInt(mPreciseCarrierId); out.writeInt(mSpecificCarrierId);
} }
@Override @Override
@@ -221,7 +227,7 @@ public class CarrierIdentifier implements Parcelable {
+ ",gid1=" + mGid1 + ",gid1=" + mGid1
+ ",gid2=" + mGid2 + ",gid2=" + mGid2
+ ",carrierid=" + mCarrierId + ",carrierid=" + mCarrierId
+ ",mPreciseCarrierId=" + mPreciseCarrierId + ",specificCarrierId=" + mSpecificCarrierId
+ "}"; + "}";
} }
@@ -234,7 +240,7 @@ public class CarrierIdentifier implements Parcelable {
mGid1 = in.readString(); mGid1 = in.readString();
mGid2 = in.readString(); mGid2 = in.readString();
mCarrierId = in.readInt(); mCarrierId = in.readInt();
mPreciseCarrierId = in.readInt(); mSpecificCarrierId = in.readInt();
} }
/** @hide */ /** @hide */

View File

@@ -4309,24 +4309,24 @@ public final class Telephony {
} }
/** /**
* Generates a content {@link Uri} used to receive updates on precise carrier identity * Generates a content {@link Uri} used to receive updates on specific carrier identity
* change on the given subscriptionId returned by * change on the given subscriptionId returned by
* {@link TelephonyManager#getSimPreciseCarrierId()}. * {@link TelephonyManager#getSimSpecificCarrierId()}.
* @see TelephonyManager#ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED * @see TelephonyManager#ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED
* <p> * <p>
* Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
* precise carrier identity {@link TelephonyManager#getSimPreciseCarrierId()} * specific carrier identity {@link TelephonyManager#getSimSpecificCarrierId()}
* while your app is running. You can also use a {@link JobService} to ensure your app * while your app is running. You can also use a {@link JobService} to ensure your app
* is notified of changes to the {@link Uri} even when it is not running. * is notified of changes to the {@link Uri} even when it is not running.
* Note, however, that using a {@link JobService} does not guarantee timely delivery of * Note, however, that using a {@link JobService} does not guarantee timely delivery of
* updates to the {@link Uri}. * updates to the {@link Uri}.
* *
* @param subscriptionId the subscriptionId to receive updates on * @param subscriptionId the subscriptionId to receive updates on
* @return the Uri used to observe precise carrier identity changes * @return the Uri used to observe specific carrier identity changes
*/ */
@NonNull @NonNull
public static Uri getPreciseCarrierIdUriForSubscriptionId(int subscriptionId) { public static Uri getSpecificCarrierIdUriForSubscriptionId(int subscriptionId) {
return Uri.withAppendedPath(Uri.withAppendedPath(CONTENT_URI, "precise"), return Uri.withAppendedPath(Uri.withAppendedPath(CONTENT_URI, "specific"),
String.valueOf(subscriptionId)); String.valueOf(subscriptionId));
} }
@@ -4346,26 +4346,30 @@ public final class Telephony {
/** /**
* A fine-grained carrier id. * A fine-grained carrier id.
* @see TelephonyManager#getSimPreciseCarrierId() * The specific carrier ID would be used for configuration purposes, but apps wishing to
* know about the carrier itself should use the regular carrier ID returned by
* {@link TelephonyManager#getSimCarrierId()}.
*
* @see TelephonyManager#getSimSpecificCarrierId()
* This is not a database column, only used to notify content observers for * This is not a database column, only used to notify content observers for
* {@link #getPreciseCarrierIdUriForSubscriptionId(int)} * {@link #getSpecificCarrierIdUriForSubscriptionId(int)}
*/ */
public static final String PRECISE_CARRIER_ID = "precise_carrier_id"; public static final String SPECIFIC_CARRIER_ID = "specific_carrier_id";
/** /**
* A user facing carrier name for precise carrier id {@link #PRECISE_CARRIER_ID}. * A user facing carrier name for specific carrier id {@link #SPECIFIC_CARRIER_ID}.
* @see TelephonyManager#getSimPreciseCarrierIdName() * @see TelephonyManager#getSimSpecificCarrierIdName()
* This is not a database column, only used to notify content observers for * This is not a database column, only used to notify content observers for
* {@link #getPreciseCarrierIdUriForSubscriptionId(int)} * {@link #getSpecificCarrierIdUriForSubscriptionId(int)}
*/ */
public static final String PRECISE_CARRIER_ID_NAME = "precise_carrier_id_name"; public static final String SPECIFIC_CARRIER_ID_NAME = "specific_carrier_id_name";
/** /**
* A unique parent carrier id. The parent-child * A unique parent carrier id. The parent-child
* relationship can be used to further differentiate a single carrier by different networks, * relationship can be used to further differentiate a single carrier by different networks,
* by prepaid v.s. postpaid or even by 4G v.s. 3G plan. It's an optional field. * by prepaid v.s. postpaid. It's an optional field.
* A carrier id with a valid parent_carrier_id is considered fine-grained carrier id, will * A carrier id with a valid parent_carrier_id is considered fine-grained specific carrier
* not be returned as {@link #CARRIER_ID} but {@link #PRECISE_CARRIER_ID}. * ID, will not be returned as {@link #CARRIER_ID} but {@link #SPECIFIC_CARRIER_ID}.
* <P>Type: INTEGER </P> * <P>Type: INTEGER </P>
* @hide * @hide
*/ */

View File

@@ -72,10 +72,10 @@ public class CarrierConfigManager {
* one is available for the slot index. An optional int extra * one is available for the slot index. An optional int extra
* {@link TelephonyManager#EXTRA_CARRIER_ID} is included to indicate the carrier id for the * {@link TelephonyManager#EXTRA_CARRIER_ID} is included to indicate the carrier id for the
* changed carrier configuration. An optional int extra * changed carrier configuration. An optional int extra
* {@link TelephonyManager#EXTRA_PRECISE_CARRIER_ID} is included to indicate the precise * {@link TelephonyManager#EXTRA_SPECIFIC_CARRIER_ID} is included to indicate the precise
* carrier id for the changed carrier configuration. * carrier id for the changed carrier configuration.
* @see TelephonyManager#getSimCarrierId() * @see TelephonyManager#getSimCarrierId()
* @see TelephonyManager#getSimPreciseCarrierId() * @see TelephonyManager#getSimSpecificCarrierId()
*/ */
public static final String public static final String
ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED";

View File

@@ -1246,30 +1246,34 @@ public class TelephonyManager {
public static final String EXTRA_CARRIER_NAME = "android.telephony.extra.CARRIER_NAME"; public static final String EXTRA_CARRIER_NAME = "android.telephony.extra.CARRIER_NAME";
/** /**
* Broadcast Action: The subscription precise carrier identity has changed. * Broadcast Action: The subscription specific carrier identity has changed.
* The precise carrier id can be used to further differentiate a carrier by different *
* networks, by prepaid v.s.postpaid or even by 4G v.s.3G plan. Each carrier has a unique * A specific carrier ID returns the fine-grained carrier ID of the current subscription.
* carrier id returned by {@link #getSimCarrierId()} but could have multiple precise carrier id. * It can represent the fact that a carrier may be in effect an aggregation of other carriers
* e.g, {@link #getSimCarrierId()} will always return Tracfone (id 2022) for a Tracfone SIM, * (ie in an MVNO type scenario) where each of these specific carriers which are used to make
* while {@link #getSimPreciseCarrierId()} can return Tracfone AT&T or Tracfone T-Mobile based * up the actual carrier service may have different carrier configurations.
* on the current subscription IMSI. For carriers without any fine-grained ids, precise carrier * A specific carrier ID could also be used, for example, in a scenario where a carrier requires
* id is same as carrier id. * different carrier configuration for different service offering such as a prepaid plan.
*
* the specific carrier ID would be used for configuration purposes, but apps wishing to know
* about the carrier itself should use the regular carrier ID returned by
* {@link #getSimCarrierId()}.
* *
* <p>Similar like {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED}, this intent will be * <p>Similar like {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED}, this intent will be
* sent on the event of {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} while its also * sent on the event of {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} while its also
* possible to be sent without {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} when * possible to be sent without {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} when
* precise carrier id changes with the same carrier id. * specific carrier ID changes while carrier ID remains the same.
* e.g, the same subscription switches to different IMSI could potentially change its * e.g, the same subscription switches to different IMSI could potentially change its
* precise carrier id while carrier id remains the same. * specific carrier ID while carrier id remains the same.
* @see #getSimPreciseCarrierId() * @see #getSimSpecificCarrierId()
* @see #getSimCarrierId() * @see #getSimCarrierId()
* *
* The intent will have the following extra values: * The intent will have the following extra values:
* <ul> * <ul>
* <li>{@link #EXTRA_PRECISE_CARRIER_ID} The up-to-date precise carrier id of the * <li>{@link #EXTRA_SPECIFIC_CARRIER_ID} The up-to-date specific carrier id of the
* current subscription. * current subscription.
* </li> * </li>
* <li>{@link #EXTRA_PRECISE_CARRIER_NAME} The up-to-date name of the precise carrier id. * <li>{@link #EXTRA_SPECIFIC_CARRIER_NAME} The up-to-date name of the specific carrier id.
* </li> * </li>
* <li>{@link #EXTRA_SUBSCRIPTION_ID} The subscription id associated with the changed carrier * <li>{@link #EXTRA_SUBSCRIPTION_ID} The subscription id associated with the changed carrier
* identity. * identity.
@@ -1278,30 +1282,30 @@ public class TelephonyManager {
* <p class="note">This is a protected intent that can only be sent by the system. * <p class="note">This is a protected intent that can only be sent by the system.
*/ */
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED = public static final String ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED =
"android.telephony.action.SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED"; "android.telephony.action.SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED";
/** /**
* An int extra used with {@link #ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED} which * An int extra used with {@link #ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED} which
* indicates the updated precise carrier id returned by * indicates the updated specific carrier id returned by
* {@link TelephonyManager#getSimPreciseCarrierId()}. Note, its possible precise carrier id * {@link TelephonyManager#getSimSpecificCarrierId()}. Note, its possible specific carrier id
* changes while {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} remains the same * changes while {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} remains the same
* e.g, when subscription switch to different IMSIs. * e.g, when subscription switch to different IMSIs.
* <p>Will be {@link TelephonyManager#UNKNOWN_CARRIER_ID} if the subscription is unavailable or * <p>Will be {@link TelephonyManager#UNKNOWN_CARRIER_ID} if the subscription is unavailable or
* the carrier cannot be identified. * the carrier cannot be identified.
*/ */
public static final String EXTRA_PRECISE_CARRIER_ID = public static final String EXTRA_SPECIFIC_CARRIER_ID =
"android.telephony.extra.PRECISE_CARRIER_ID"; "android.telephony.extra.SPECIFIC_CARRIER_ID";
/** /**
* An string extra used with {@link #ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED} which * An string extra used with {@link #ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED}
* indicates the updated precise carrier name returned by * which indicates the updated specific carrier name returned by
* {@link TelephonyManager#getSimPreciseCarrierIdName()}. * {@link TelephonyManager#getSimSpecificCarrierIdName()}.
* <p>it's a user-facing name of the precise carrier id {@link #EXTRA_PRECISE_CARRIER_ID}, e.g, * <p>it's a user-facing name of the specific carrier id {@link #EXTRA_SPECIFIC_CARRIER_ID}
* Tracfone-AT&T. * e.g, Tracfone-AT&T
*/ */
public static final String EXTRA_PRECISE_CARRIER_NAME = public static final String EXTRA_SPECIFIC_CARRIER_NAME =
"android.telephony.extra.PRECISE_CARRIER_NAME"; "android.telephony.extra.SPECIFIC_CARRIER_NAME";
/** /**
* An int extra used with {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} to indicate the * An int extra used with {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} to indicate the
@@ -8913,17 +8917,23 @@ public class TelephonyManager {
} }
/** /**
* Returns fine-grained carrier id of the current subscription. * Returns fine-grained carrier ID of the current subscription.
* *
* <p>The precise carrier id can be used to further differentiate a carrier by different * A specific carrier ID can represent the fact that a carrier may be in effect an aggregation
* networks, by prepaid v.s.postpaid or even by 4G v.s.3G plan. Each carrier has a unique * of other carriers (ie in an MVNO type scenario) where each of these specific carriers which
* carrier id returned by {@link #getSimCarrierId()} but could have multiple precise carrier id. * are used to make up the actual carrier service may have different carrier configurations.
* e.g, {@link #getSimCarrierId()} will always return Tracfone (id 2022) for a Tracfone SIM, * A specific carrier ID could also be used, for example, in a scenario where a carrier requires
* while {@link #getSimPreciseCarrierId()} can return Tracfone AT&T or Tracfone T-Mobile based * different carrier configuration for different service offering such as a prepaid plan.
* on the current subscription IMSI.
* *
* <p>For carriers without any fine-grained carrier ids, return {@link #getSimCarrierId()} * the specific carrier ID would be used for configuration purposes, but apps wishing to know
* <p>Precise carrier ids are defined in the same way as carrier id * about the carrier itself should use the regular carrier ID returned by
* {@link #getSimCarrierId()}.
*
* e.g, Tracfone SIMs could return different specific carrier ID based on IMSI from current
* subscription while carrier ID remains the same.
*
* <p>For carriers without fine-grained specific carrier ids, return {@link #getSimCarrierId()}
* <p>Specific carrier ids are defined in the same way as carrier id
* <a href="https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/master/assets/carrier_list.textpb">here</a> * <a href="https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/master/assets/carrier_list.textpb">here</a>
* except each with a "parent" id linking to its top-level carrier id. * except each with a "parent" id linking to its top-level carrier id.
* *
@@ -8931,11 +8941,11 @@ public class TelephonyManager {
* Return {@link #UNKNOWN_CARRIER_ID} if the subscription is unavailable or the carrier cannot * Return {@link #UNKNOWN_CARRIER_ID} if the subscription is unavailable or the carrier cannot
* be identified. * be identified.
*/ */
public int getSimPreciseCarrierId() { public int getSimSpecificCarrierId() {
try { try {
ITelephony service = getITelephony(); ITelephony service = getITelephony();
if (service != null) { if (service != null) {
return service.getSubscriptionPreciseCarrierId(getSubId()); return service.getSubscriptionSpecificCarrierId(getSubId());
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
// This could happen if binder process crashes. // This could happen if binder process crashes.
@@ -8945,18 +8955,22 @@ public class TelephonyManager {
/** /**
* Similar like {@link #getSimCarrierIdName()}, returns user-facing name of the * Similar like {@link #getSimCarrierIdName()}, returns user-facing name of the
* precise carrier id returned by {@link #getSimPreciseCarrierId()}. * specific carrier id returned by {@link #getSimSpecificCarrierId()}.
*
* The specific carrier ID would be used for configuration purposes, but apps wishing to know
* about the carrier itself should use the regular carrier ID returned by
* {@link #getSimCarrierIdName()}.
* *
* <p>The returned name is unlocalized. * <p>The returned name is unlocalized.
* *
* @return user-facing name of the subscription precise carrier id. Return {@code null} if the * @return user-facing name of the subscription specific carrier id. Return {@code null} if the
* subscription is unavailable or the carrier cannot be identified. * subscription is unavailable or the carrier cannot be identified.
*/ */
public @Nullable CharSequence getSimPreciseCarrierIdName() { public @Nullable CharSequence getSimSpecificCarrierIdName() {
try { try {
ITelephony service = getITelephony(); ITelephony service = getITelephony();
if (service != null) { if (service != null) {
return service.getSubscriptionPreciseCarrierName(getSubId()); return service.getSubscriptionSpecificCarrierName(getSubId());
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
// This could happen if binder process crashes. // This could happen if binder process crashes.

View File

@@ -1369,7 +1369,7 @@ interface ITelephony {
/** /**
* Returns fine-grained carrier id of the current subscription. * Returns fine-grained carrier id of the current subscription.
* *
* <p>The precise carrier id can be used to further differentiate a carrier by different * <p>The specific carrier id can be used to further differentiate a carrier by different
* networks, by prepaid v.s.postpaid or even by 4G v.s.3G plan. Each carrier has a unique * networks, by prepaid v.s.postpaid or even by 4G v.s.3G plan. Each carrier has a unique
* carrier id {@link #getSimCarrierId()} but can have multiple precise carrier id. e.g, * carrier id {@link #getSimCarrierId()} but can have multiple precise carrier id. e.g,
* {@link #getSimCarrierId()} will always return Tracfone (id 2022) for a Tracfone SIM, while * {@link #getSimCarrierId()} will always return Tracfone (id 2022) for a Tracfone SIM, while
@@ -1383,19 +1383,19 @@ interface ITelephony {
* be identified. * be identified.
* @hide * @hide
*/ */
int getSubscriptionPreciseCarrierId(int subId); int getSubscriptionSpecificCarrierId(int subId);
/** /**
* Similar like {@link #getSimCarrierIdName()}, returns user-facing name of the * Similar like {@link #getSimCarrierIdName()}, returns user-facing name of the
* precise carrier id {@link #getSimPreciseCarrierId()} * specific carrier id {@link #getSimSpecificCarrierId()}
* *
* <p>The returned name is unlocalized. * <p>The returned name is unlocalized.
* *
* @return user-facing name of the subscription precise carrier id. Return {@code null} if the * @return user-facing name of the subscription specific carrier id. Return {@code null} if the
* subscription is unavailable or the carrier cannot be identified. * subscription is unavailable or the carrier cannot be identified.
* @hide * @hide
*/ */
String getSubscriptionPreciseCarrierName(int subId); String getSubscriptionSpecificCarrierName(int subId);
/** /**
* Returns carrier id based on MCCMNC only. This will return a MNO carrier id used for fallback * Returns carrier id based on MCCMNC only. This will return a MNO carrier id used for fallback