Merge "consistent permission check for getSubIdForPhoneAccount"

This commit is contained in:
Chen Xu
2021-05-17 22:27:20 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 12 deletions

View File

@@ -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;
}

View File

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