From 2a09217315c85a3af100f1d27bf727436c60fb88 Mon Sep 17 00:00:00 2001 From: fionaxu Date: Wed, 7 Mar 2018 21:52:05 -0800 Subject: [PATCH] Carrier id api rename Rename getAndroidCarrierIdForSubscription to getSimCarrierId. Drop prefix "Android" as Android is implicit everywhere. Rename carrierName to CarrierIdName to imply correlation between these two APIs. This also helps to differentiate from another API getSimOperatorName. Bug: 71584605 Test: build Change-Id: Iba4b1c21522741b8c11836a4c39004064736b4c6 (cherry picked from commit c8d483e488b8fb75e997a4a48c632e20cae0f4b7) Merged-in: Iba4b1c21522741b8c11836a4c39004064736b4c6 --- api/current.txt | 4 ++-- .../java/android/telephony/Telephony.java | 6 +++--- .../android/telephony/TelephonyManager.java | 21 +++++++++---------- .../internal/telephony/ITelephony.aidl | 4 ++-- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/api/current.txt b/api/current.txt index c1ed2121653b3..ca505ebd3ed6a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -40831,8 +40831,6 @@ 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(); @@ -40863,6 +40861,8 @@ package android.telephony { method public int getPhoneType(); method public android.telephony.ServiceState getServiceState(); method public android.telephony.SignalStrength getSignalStrength(); + method public int getSimCarrierId(); + method public java.lang.CharSequence getSimCarrierIdName(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); method public java.lang.String getSimOperatorName(); diff --git a/telephony/java/android/telephony/Telephony.java b/telephony/java/android/telephony/Telephony.java index fb52ff704a148..4f78c4cc78adb 100644 --- a/telephony/java/android/telephony/Telephony.java +++ b/telephony/java/android/telephony/Telephony.java @@ -3380,7 +3380,7 @@ public final class Telephony { * on the given subscriptionId *

* Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the - * carrier identity {@link TelephonyManager#getAndroidCarrierIdForSubscription()} + * carrier identity {@link TelephonyManager#getSimCarrierId()} * 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 @@ -3396,14 +3396,14 @@ public final class Telephony { /** * A user facing carrier name. - * @see TelephonyManager#getAndroidCarrierNameForSubscription() + * @see TelephonyManager#getSimCarrierIdName() *

Type: TEXT

*/ public static final String CARRIER_NAME = "carrier_name"; /** * A unique carrier id - * @see TelephonyManager#getAndroidCarrierIdForSubscription() + * @see TelephonyManager#getSimCarrierId() *

Type: INTEGER

*/ public static final String CARRIER_ID = "carrier_id"; diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 2ba9eaca7f08f..49cc678068aaf 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -52,7 +52,6 @@ import android.telephony.ims.aidl.IImsConfig; import android.telephony.ims.aidl.IImsMmTelFeature; import android.telephony.ims.aidl.IImsRcsFeature; import android.telephony.ims.aidl.IImsRegistration; -import android.telephony.ims.feature.ImsFeature; import android.telephony.ims.stub.ImsRegistrationImplBase; import android.util.Log; @@ -1049,7 +1048,7 @@ public class TelephonyManager { /** * An int extra used with {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} which indicates - * the updated carrier id {@link TelephonyManager#getAndroidCarrierIdForSubscription()} of + * the updated carrier id {@link TelephonyManager#getSimCarrierId()} of * the current subscription. *

Will be {@link TelephonyManager#UNKNOWN_CARRIER_ID} if the subscription is unavailable or * the carrier cannot be identified. @@ -1059,7 +1058,7 @@ public class TelephonyManager { /** * An string extra used with {@link #ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED} which * indicates the updated carrier name of the current subscription. - * {@see TelephonyManager#getSubscriptionCarrierName()} + * {@see TelephonyManager#getSimCarrierIdName()} *

Carrier name is a user-facing name of the carrier id {@link #EXTRA_CARRIER_ID}, * usually the brand name of the subsidiary (e.g. T-Mobile). */ @@ -7127,8 +7126,8 @@ public class TelephonyManager { /** * Returns carrier id of the current subscription. *

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 + * carrier with a canonical integer a.k.a. carrier id. The 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 @@ -7137,7 +7136,7 @@ public class TelephonyManager { * @return Carrier id of the current subscription. Return {@link #UNKNOWN_CARRIER_ID} if the * subscription is unavailable or the carrier cannot be identified. */ - public int getAndroidCarrierIdForSubscription() { + public int getSimCarrierId() { try { ITelephony service = getITelephony(); if (service != null) { @@ -7151,18 +7150,18 @@ public class TelephonyManager { } /** - * Returns carrier name of the current subscription. - *

Carrier name is a user-facing name of carrier id - * {@link #getAndroidCarrierIdForSubscription()}, usually the brand name of the subsidiary + * Returns carrier id name of the current subscription. + *

Carrier id name is a user-facing name of carrier id + * {@link #getSimCarrierId()}, 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. + * use {@link #getSimCarrierId()} 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. */ - public CharSequence getAndroidCarrierNameForSubscription() { + public CharSequence getSimCarrierIdName() { try { ITelephony service = getITelephony(); if (service != null) { diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 18c69ac728679..e2f1fdc2cccfe 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1358,10 +1358,10 @@ interface ITelephony { /** * Returns carrier name of the given subscription. - *

Carrier name is a user-facing name of carrier id {@link #getSubscriptionCarrierId(int)}, + *

Carrier name is a user-facing name of carrier id {@link #getSimCarrierId(int)}, * 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 canonical identity, use {@link #getSubscriptionCarrierId(int)} instead. + * Carrier name is not canonical identity, use {@link #getSimCarrierId(int)} instead. *

Returned carrier name is unlocalized. * * @return Carrier name of given subscription id. return {@code null} if subscription is