Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f6b2726 authored by Chen Xu's avatar Chen Xu Committed by Gerrit Code Review
Browse files

Merge "address carrier id api review feedback"

parents 222529d9 ac1defab
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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<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();
@@ -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();
+16 −10
Original line number Diff line number Diff line
@@ -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.
     * <p>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.
     * <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());
@@ -6738,17 +6743,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());