diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 78da86c57ef13..5151a2c34d4fe 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -11115,14 +11115,10 @@ public class TelephonyManager { @UnsupportedAppUsage public int getSubIdForPhoneAccount(@Nullable PhoneAccount phoneAccount) { int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID; - try { - ITelephony service = getITelephony(); - if (service != null) { - retval = service.getSubIdForPhoneAccount(phoneAccount); - } - } catch (RemoteException e) { + if (phoneAccount != null + && phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { + retval = getSubscriptionId(phoneAccount.getAccountHandle()); } - return retval; } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 4cd59a24b1826..453eeb59bb354 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1353,11 +1353,6 @@ interface ITelephony { String getDeviceSoftwareVersionForSlot(int slotIndex, String callingPackage, String callingFeatureId); - /** - * Returns the subscription ID associated with the specified PhoneAccount. - */ - int getSubIdForPhoneAccount(in PhoneAccount phoneAccount); - /** * Returns the subscription ID associated with the specified PhoneAccountHandle. */