diff --git a/api/current.txt b/api/current.txt index 55f885cdf7af6..e9346f625285d 100755 --- a/api/current.txt +++ b/api/current.txt @@ -37321,13 +37321,13 @@ package android.provider { } 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); field public static final String CARRIER_ID = "carrier_id"; field public static final String CARRIER_NAME = "carrier_name"; 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 PRECISE_CARRIER_ID_NAME = "precise_carrier_id_name"; + field public static final String SPECIFIC_CARRIER_ID = "specific_carrier_id"; + field public static final String SPECIFIC_CARRIER_ID_NAME = "specific_carrier_id_name"; } public static final class Telephony.Carriers implements android.provider.BaseColumns { @@ -39449,7 +39449,7 @@ package android.service.carrier { method @Nullable public String getImsi(); method public String getMcc(); method public String getMnc(); - method public int getPreciseCarrierId(); + method public int getSpecificCarrierId(); method @Nullable public String getSpn(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; @@ -43069,9 +43069,9 @@ package android.telephony { method public String getSimCountryIso(); method public String getSimOperator(); 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 public int getSimSpecificCarrierId(); + method @Nullable public CharSequence getSimSpecificCarrierIdName(); method public int getSimState(); method public int getSimState(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSubscriberId(); @@ -43131,7 +43131,7 @@ package android.telephony { 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_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_ISIM = 5; // 0x5 field public static final int APPTYPE_RUIM = 3; // 0x3 @@ -43166,8 +43166,8 @@ package android.telephony { 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_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_PRECISE_CARRIER_NAME = "android.telephony.extra.PRECISE_CARRIER_NAME"; + field public static final String EXTRA_SPECIFIC_CARRIER_ID = "android.telephony.extra.SPECIFIC_CARRIER_ID"; + 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_IDLE; field public static final String EXTRA_STATE_OFFHOOK; diff --git a/core/java/android/service/carrier/CarrierIdentifier.java b/core/java/android/service/carrier/CarrierIdentifier.java index 8c73a87e2132f..3b71aa740fc06 100644 --- a/core/java/android/service/carrier/CarrierIdentifier.java +++ b/core/java/android/service/carrier/CarrierIdentifier.java @@ -55,7 +55,7 @@ public class CarrierIdentifier implements Parcelable { private @Nullable String mGid1; private @Nullable String mGid2; 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, @Nullable String gid1, @Nullable String gid2) { @@ -72,12 +72,12 @@ public class CarrierIdentifier implements Parcelable { * @param gid2 group id level 2 * @param carrierid carrier unique identifier {@link TelephonyManager#getSimCarrierId()}, used * to uniquely identify the carrier and look up the carrier configurations. - * @param preciseCarrierId precise carrier identifier - * {@link TelephonyManager#getSimPreciseCarrierId()} + * @param specificCarrierId specific carrier identifier + * {@link TelephonyManager#getSimSpecificCarrierId()} */ public CarrierIdentifier(@NonNull String mcc, @NonNull String mnc, @Nullable String spn, @Nullable String imsi, @Nullable String gid1, @Nullable String gid2, - int carrierid, int preciseCarrierId) { + int carrierid, int specificCarrierId) { mMcc = mcc; mMnc = mnc; mSpn = spn; @@ -85,7 +85,7 @@ public class CarrierIdentifier implements Parcelable { mGid1 = gid1; mGid2 = gid2; mCarrierId = carrierid; - mPreciseCarrierId = preciseCarrierId; + mSpecificCarrierId = specificCarrierId; } /** @@ -162,11 +162,17 @@ public class CarrierIdentifier implements Parcelable { } /** - * Returns the precise carrier id. - * @see TelephonyManager#getSimPreciseCarrierId() + * A specific carrier ID returns the fine-grained carrier ID of the current subscription. + * 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() { - return mPreciseCarrierId; + public int getSpecificCarrierId() { + return mSpecificCarrierId; } @Override @@ -186,12 +192,12 @@ public class CarrierIdentifier implements Parcelable { && Objects.equals(mGid1, that.mGid1) && Objects.equals(mGid2, that.mGid2) && Objects.equals(mCarrierId, that.mCarrierId) - && Objects.equals(mPreciseCarrierId, that.mPreciseCarrierId); + && Objects.equals(mSpecificCarrierId, that.mSpecificCarrierId); } @Override 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 @@ -208,7 +214,7 @@ public class CarrierIdentifier implements Parcelable { out.writeString(mGid1); out.writeString(mGid2); out.writeInt(mCarrierId); - out.writeInt(mPreciseCarrierId); + out.writeInt(mSpecificCarrierId); } @Override @@ -221,7 +227,7 @@ public class CarrierIdentifier implements Parcelable { + ",gid1=" + mGid1 + ",gid2=" + mGid2 + ",carrierid=" + mCarrierId - + ",mPreciseCarrierId=" + mPreciseCarrierId + + ",specificCarrierId=" + mSpecificCarrierId + "}"; } @@ -234,7 +240,7 @@ public class CarrierIdentifier implements Parcelable { mGid1 = in.readString(); mGid2 = in.readString(); mCarrierId = in.readInt(); - mPreciseCarrierId = in.readInt(); + mSpecificCarrierId = in.readInt(); } /** @hide */ diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java index 4939157cd93b3..983d1341400e7 100644 --- a/telephony/java/android/provider/Telephony.java +++ b/telephony/java/android/provider/Telephony.java @@ -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 - * {@link TelephonyManager#getSimPreciseCarrierId()}. - * @see TelephonyManager#ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED + * {@link TelephonyManager#getSimSpecificCarrierId()}. + * @see TelephonyManager#ACTION_SUBSCRIPTION_SPECIFIC_CARRIER_IDENTITY_CHANGED *

* 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 * 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 * updates to the {@link Uri}. * * @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 - public static Uri getPreciseCarrierIdUriForSubscriptionId(int subscriptionId) { - return Uri.withAppendedPath(Uri.withAppendedPath(CONTENT_URI, "precise"), + public static Uri getSpecificCarrierIdUriForSubscriptionId(int subscriptionId) { + return Uri.withAppendedPath(Uri.withAppendedPath(CONTENT_URI, "specific"), String.valueOf(subscriptionId)); } @@ -4346,26 +4346,30 @@ public final class Telephony { /** * 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 - * {@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}. - * @see TelephonyManager#getSimPreciseCarrierIdName() + * A user facing carrier name for specific carrier id {@link #SPECIFIC_CARRIER_ID}. + * @see TelephonyManager#getSimSpecificCarrierIdName() * 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 * 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. - * A carrier id with a valid parent_carrier_id is considered fine-grained carrier id, will - * not be returned as {@link #CARRIER_ID} but {@link #PRECISE_CARRIER_ID}. + * by prepaid v.s. postpaid. It's an optional field. + * A carrier id with a valid parent_carrier_id is considered fine-grained specific carrier + * ID, will not be returned as {@link #CARRIER_ID} but {@link #SPECIFIC_CARRIER_ID}. *

Type: INTEGER

* @hide */ diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 9cdd53ea7654a..89c65a09057b2 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -72,10 +72,10 @@ public class CarrierConfigManager { * 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 * 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. * @see TelephonyManager#getSimCarrierId() - * @see TelephonyManager#getSimPreciseCarrierId() + * @see TelephonyManager#getSimSpecificCarrierId() */ public static final String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 6e762b3a91cde..908b68d68d38e 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1246,30 +1246,34 @@ public class TelephonyManager { public static final String EXTRA_CARRIER_NAME = "android.telephony.extra.CARRIER_NAME"; /** - * Broadcast Action: The subscription precise 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 - * carrier id returned by {@link #getSimCarrierId()} but could have multiple precise carrier id. - * e.g, {@link #getSimCarrierId()} will always return Tracfone (id 2022) for a Tracfone SIM, - * while {@link #getSimPreciseCarrierId()} can return Tracfone AT&T or Tracfone T-Mobile based - * on the current subscription IMSI. For carriers without any fine-grained ids, precise carrier - * id is same as carrier id. + * Broadcast Action: The subscription specific carrier identity has changed. + * + * A specific carrier ID returns the fine-grained carrier ID of the current subscription. + * 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. + * + * 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()}. * *

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 * 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 - * precise carrier id while carrier id remains the same. - * @see #getSimPreciseCarrierId() + * specific carrier ID while carrier id remains the same. + * @see #getSimSpecificCarrierId() * @see #getSimCarrierId() * * The intent will have the following extra values: *