diff --git a/api/current.txt b/api/current.txt index abdccf3767891..c51486c4e4a16 100644 --- a/api/current.txt +++ b/api/current.txt @@ -40738,6 +40738,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 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(); @@ -40774,8 +40776,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 99a966a9d88e4..43139aa4669fa 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -993,8 +993,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. *

Will be {@link TelephonyManager#UNKNOWN_CARRIER_ID} if the subscription is unavailable or * the carrier cannot be identified. */ @@ -6715,14 +6715,19 @@ public class TelephonyManager { /** * Returns carrier id of the current subscription. - *

To recognize a carrier (including MVNO) as a first class identity, assign each carrier - * with a canonical integer a.k.a carrier id. + *

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 + * here + * + *

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()); @@ -6738,17 +6743,18 @@ public class TelephonyManager { /** * Returns carrier name of the current subscription. - *

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. + *

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. *

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());