From 557393c7ebc1dcabf1c1ad3731e2d56be0729cca Mon Sep 17 00:00:00 2001 From: Shuo Qian Date: Thu, 7 Nov 2019 19:06:01 +0000 Subject: Change getSubIdForPhoneAccountHandle to getSubscriptionId Test: Build Bug: 144097052 Change-Id: I1e31bd469855b800e825b58130c7034222ccfb83 (cherry picked from commit 8ebad8def6a25e0275e704a6a6fc764f9cac061a) --- api/current.txt | 2 +- telephony/java/android/telephony/TelephonyManager.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/current.txt b/api/current.txt index f51f345690aa..efadbeae7021 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45028,8 +45028,8 @@ package android.telephony { method @Nullable public CharSequence getSimSpecificCarrierIdName(); method public int getSimState(); method public int getSimState(int); - method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getSubIdForPhoneAccountHandle(@NonNull android.telecom.PhoneAccountHandle); method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getSubscriberId(); + method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getSubscriptionId(@NonNull android.telecom.PhoneAccountHandle); method public int getSupportedModemCount(); method @Nullable public String getTypeAllocationCode(); method @Nullable public String getTypeAllocationCode(int); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 63cd51189de9..fe7e7e665d3c 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -454,7 +454,7 @@ public class TelephonyManager { */ @Nullable public TelephonyManager createForPhoneAccountHandle(PhoneAccountHandle phoneAccountHandle) { - int subId = getSubIdForPhoneAccountHandle(phoneAccountHandle); + int subId = getSubscriptionId(phoneAccountHandle); if (!SubscriptionManager.isValidSubscriptionId(subId)) { return null; } @@ -9429,7 +9429,7 @@ public class TelephonyManager { * permission. */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - public int getSubIdForPhoneAccountHandle(@NonNull PhoneAccountHandle phoneAccountHandle) { + public int getSubscriptionId(@NonNull PhoneAccountHandle phoneAccountHandle) { int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID; try { ITelephony service = getITelephony(); @@ -9438,7 +9438,7 @@ public class TelephonyManager { phoneAccountHandle, mContext.getOpPackageName()); } } catch (RemoteException ex) { - Log.e(TAG, "getSubIdForPhoneAccountHandle RemoteException", ex); + Log.e(TAG, "getSubscriptionId RemoteException", ex); ex.rethrowAsRuntimeException(); } return retval; -- cgit v1.2.3-59-g8ed1b