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

Commit 7b4ed646 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Add getSelfManagedPhoneAccounts() TelecomManager API."

parents 9cd99a08 89317070
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39344,6 +39344,7 @@ package android.telecom {
    method public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(java.lang.String);
    method public java.lang.String getLine1Number(android.telecom.PhoneAccountHandle);
    method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
    method public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts();
    method public android.telecom.PhoneAccountHandle getSimCallManager();
    method public java.lang.String getVoiceMailNumber(android.telecom.PhoneAccountHandle);
    method public boolean handleMmi(java.lang.String);
+1 −0
Original line number Diff line number Diff line
@@ -42784,6 +42784,7 @@ package android.telecom {
    method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
    method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsForPackage();
    method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(java.lang.String);
    method public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts();
    method public android.telecom.PhoneAccountHandle getSimCallManager();
    method public java.lang.String getVoiceMailNumber(android.telecom.PhoneAccountHandle);
    method public boolean handleMmi(java.lang.String);
+1 −0
Original line number Diff line number Diff line
@@ -39560,6 +39560,7 @@ package android.telecom {
    method public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(java.lang.String);
    method public java.lang.String getLine1Number(android.telecom.PhoneAccountHandle);
    method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
    method public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts();
    method public android.telecom.PhoneAccountHandle getSimCallManager();
    method public java.lang.String getVoiceMailNumber(android.telecom.PhoneAccountHandle);
    method public boolean handleMmi(java.lang.String);
+26 −0
Original line number Diff line number Diff line
@@ -754,6 +754,32 @@ public class TelecomManager {
        return getCallCapablePhoneAccounts(false);
    }

    /**
     * Returns a list of {@link PhoneAccountHandle}s for self-managed {@link ConnectionService}s.
     * <p>
     * Self-Managed {@link ConnectionService}s have a {@link PhoneAccount} with
     * {@link PhoneAccount#CAPABILITY_SELF_MANAGED}.
     * <p>
     * Requires permission {@link android.Manifest.permission#READ_PHONE_STATE}, or that the caller
     * is the default dialer app.
     * <p>
     * A {@link SecurityException} will be thrown if a called is not the default dialer, or lacks
     * the {@link android.Manifest.permission#READ_PHONE_STATE} permission.
     *
     * @return A list of {@code PhoneAccountHandle} objects.
     */
    @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
    public List<PhoneAccountHandle> getSelfManagedPhoneAccounts() {
        try {
            if (isServiceConnected()) {
                return getTelecomService().getSelfManagedPhoneAccounts(mContext.getOpPackageName());
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelecomService#getSelfManagedPhoneAccounts()", e);
        }
        return new ArrayList<>();
    }

    /**
     * Returns a list of {@link PhoneAccountHandle}s including those which have not been enabled
     * by the user.
+5 −0
Original line number Diff line number Diff line
@@ -58,6 +58,11 @@ interface ITelecomService {
    List<PhoneAccountHandle> getCallCapablePhoneAccounts(
            boolean includeDisabledAccounts, String callingPackage);

    /**
     * @see TelecomServiceImpl#getSelfManagedPhoneAccounts
     */
    List<PhoneAccountHandle> getSelfManagedPhoneAccounts(String callingPackage);

    /**
     * @see TelecomManager#getPhoneAccountsSupportingScheme
     */