diff options
| -rw-r--r-- | api/current.txt | 4 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 26 |
2 files changed, 18 insertions, 12 deletions
diff --git a/api/current.txt b/api/current.txt index 81d2aceeb49b..f3058d332fa6 100644 --- a/api/current.txt +++ b/api/current.txt @@ -41460,6 +41460,8 @@ package android.telephony { method public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method public java.util.List<android.telephony.CellInfo> getAllCellInfo(); + method public int getAndroidCarrierIdForSubscription(); + method public java.lang.CharSequence getAndroidCarrierNameForSubscription(); method public int getCallState(); method public android.os.PersistableBundle getCarrierConfig(); method public deprecated android.telephony.CellLocation getCellLocation(); @@ -41497,8 +41499,6 @@ package android.telephony { method public int getSimState(); method public int getSimState(int); method public java.lang.String getSubscriberId(); - method public int getSubscriptionCarrierId(); - method public java.lang.String getSubscriptionCarrierName(); method public java.lang.String getVisualVoicemailPackageName(); method public java.lang.String getVoiceMailAlphaTag(); method public java.lang.String getVoiceMailNumber(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index de9e691eadcf..17f809d3863a 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1024,8 +1024,8 @@ public class TelephonyManager { /** * An int extra used with {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} which indicates - * the updated carrier id {@link TelephonyManager#getSubscriptionCarrierId()} of the current - * subscription. + * the updated carrier id {@link TelephonyManager#getAndroidCarrierIdForSubscription()} of + * the current subscription. * <p>Will be {@link TelephonyManager#UNKNOWN_CARRIER_ID} if the subscription is unavailable or * the carrier cannot be identified. */ @@ -6900,14 +6900,19 @@ public class TelephonyManager { /** * Returns carrier id of the current subscription. - * <p>To recognize a carrier (including MVNO) as a first class identity, assign each carrier - * with a canonical integer a.k.a carrier id. + * <p>To recognize a carrier (including MVNO) as a first-class identity, Android assigns each + * carrier with a canonical integer a.k.a. android carrier id. The Android carrier ID is an + * Android platform-wide identifier for a carrier. AOSP maintains carrier ID assignments in + * <a href="https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/master/assets/carrier_list.textpb">here</a> + * + * <p>Apps which have carrier-specific configurations or business logic can use the carrier id + * as an Android platform-wide identifier for carriers. * * @return Carrier id of the current subscription. Return {@link #UNKNOWN_CARRIER_ID} if the * subscription is unavailable or the carrier cannot be identified. * @throws IllegalStateException if telephony service is unavailable. */ - public int getSubscriptionCarrierId() { + public int getAndroidCarrierIdForSubscription() { try { ITelephony service = getITelephony(); return service.getSubscriptionCarrierId(getSubId()); @@ -6923,17 +6928,18 @@ public class TelephonyManager { /** * Returns carrier name of the current subscription. - * <p>Carrier name is a user-facing name of carrier id {@link #getSubscriptionCarrierId()}, - * usually the brand name of the subsidiary (e.g. T-Mobile). Each carrier could configure - * multiple {@link #getSimOperatorName() SPN} but should have a single carrier name. - * Carrier name is not a canonical identity, use {@link #getSubscriptionCarrierId()} instead. + * <p>Carrier name is a user-facing name of carrier id + * {@link #getAndroidCarrierIdForSubscription()}, usually the brand name of the subsidiary + * (e.g. T-Mobile). Each carrier could configure multiple {@link #getSimOperatorName() SPN} but + * should have a single carrier name. Carrier name is not a canonical identity, + * use {@link #getAndroidCarrierIdForSubscription()} instead. * <p>The returned carrier name is unlocalized. * * @return Carrier name of the current subscription. Return {@code null} if the subscription is * unavailable or the carrier cannot be identified. * @throws IllegalStateException if telephony service is unavailable. */ - public String getSubscriptionCarrierName() { + public CharSequence getAndroidCarrierNameForSubscription() { try { ITelephony service = getITelephony(); return service.getSubscriptionCarrierName(getSubId()); |