Loading src/com/android/server/telecom/PhoneAccountRegistrar.java +18 −0 Original line number Diff line number Diff line Loading @@ -576,6 +576,24 @@ public class PhoneAccountRegistrar { uriScheme, null, includeDisabledAccounts, userHandle); } /** * Retrieves a list of all phone accounts which have * {@link PhoneAccount#CAPABILITY_SELF_MANAGED}. * <p> * Returns only the {@link PhoneAccount}s which are enabled as self-managed accounts are * automatically enabled by default (see {@link #registerPhoneAccount(PhoneAccount)}). * * @param userHandle User handle of phone account owner. * @return The phone account handles. */ public List<PhoneAccountHandle> getSelfManagedPhoneAccounts(UserHandle userHandle) { return getPhoneAccountHandles( PhoneAccount.CAPABILITY_SELF_MANAGED, PhoneAccount.CAPABILITY_EMERGENCY_CALLS_ONLY /* excludedCapabilities */, null /* uriScheme */, null /* packageName */, false /* includeDisabledAccounts */, userHandle); } public List<PhoneAccountHandle> getCallCapablePhoneAccountsOfCurrentUser( String uriScheme, boolean includeDisabledAccounts) { return getCallCapablePhoneAccounts(uriScheme, includeDisabledAccounts, mCurrentUserHandle); Loading src/com/android/server/telecom/TelecomServiceImpl.java +25 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,31 @@ public class TelecomServiceImpl { } } @Override public List<PhoneAccountHandle> getSelfManagedPhoneAccounts(String callingPackage) { try { Log.startSession("TSI.gSMPA"); if (!canReadPhoneState(callingPackage, "Requires READ_PHONE_STATE permission.")) { throw new SecurityException("Requires READ_PHONE_STATE permission."); } synchronized (mLock) { final UserHandle callingUserHandle = Binder.getCallingUserHandle(); long token = Binder.clearCallingIdentity(); try { return mPhoneAccountRegistrar.getSelfManagedPhoneAccounts( callingUserHandle); } catch (Exception e) { Log.e(this, e, "getSelfManagedPhoneAccounts"); throw e; } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } } @Override public List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(String uriScheme, String callingPackage) { Loading Loading
src/com/android/server/telecom/PhoneAccountRegistrar.java +18 −0 Original line number Diff line number Diff line Loading @@ -576,6 +576,24 @@ public class PhoneAccountRegistrar { uriScheme, null, includeDisabledAccounts, userHandle); } /** * Retrieves a list of all phone accounts which have * {@link PhoneAccount#CAPABILITY_SELF_MANAGED}. * <p> * Returns only the {@link PhoneAccount}s which are enabled as self-managed accounts are * automatically enabled by default (see {@link #registerPhoneAccount(PhoneAccount)}). * * @param userHandle User handle of phone account owner. * @return The phone account handles. */ public List<PhoneAccountHandle> getSelfManagedPhoneAccounts(UserHandle userHandle) { return getPhoneAccountHandles( PhoneAccount.CAPABILITY_SELF_MANAGED, PhoneAccount.CAPABILITY_EMERGENCY_CALLS_ONLY /* excludedCapabilities */, null /* uriScheme */, null /* packageName */, false /* includeDisabledAccounts */, userHandle); } public List<PhoneAccountHandle> getCallCapablePhoneAccountsOfCurrentUser( String uriScheme, boolean includeDisabledAccounts) { return getCallCapablePhoneAccounts(uriScheme, includeDisabledAccounts, mCurrentUserHandle); Loading
src/com/android/server/telecom/TelecomServiceImpl.java +25 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,31 @@ public class TelecomServiceImpl { } } @Override public List<PhoneAccountHandle> getSelfManagedPhoneAccounts(String callingPackage) { try { Log.startSession("TSI.gSMPA"); if (!canReadPhoneState(callingPackage, "Requires READ_PHONE_STATE permission.")) { throw new SecurityException("Requires READ_PHONE_STATE permission."); } synchronized (mLock) { final UserHandle callingUserHandle = Binder.getCallingUserHandle(); long token = Binder.clearCallingIdentity(); try { return mPhoneAccountRegistrar.getSelfManagedPhoneAccounts( callingUserHandle); } catch (Exception e) { Log.e(this, e, "getSelfManagedPhoneAccounts"); throw e; } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } } @Override public List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(String uriScheme, String callingPackage) { Loading