Loading telecomm/java/android/telecom/TelecomManager.java +27 −0 Original line number Diff line number Diff line Loading @@ -2600,6 +2600,33 @@ public class TelecomManager { return false; } /** * Determines whether there are any ongoing {@link PhoneAccount#CAPABILITY_SELF_MANAGED} * calls for a given {@code packageName} and {@code userHandle}. * * @param packageName the package name of the app to check calls for. * @param userHandle the user handle on which to check for calls. * @return {@code true} if there are ongoing calls, {@code false} otherwise. * @hide */ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isInSelfManagedCall(@NonNull String packageName, @NonNull UserHandle userHandle) { ITelecomService service = getTelecomService(); if (service != null) { try { return service.isInSelfManagedCall(packageName, userHandle, mContext.getOpPackageName()); } catch (RemoteException e) { Log.e(TAG, "RemoteException isInSelfManagedCall: " + e); e.rethrowFromSystemServer(); return false; } } else { throw new IllegalStateException("Telecom service is not present"); } } /** * Handles {@link Intent#ACTION_CALL} intents trampolined from UserCallActivity. * @param intent The {@link Intent#ACTION_CALL} intent to handle. Loading telecomm/java/com/android/internal/telecom/ITelecomService.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.telecom.TelecomAnalytics; import android.telecom.PhoneAccountHandle; import android.net.Uri; import android.os.Bundle; import android.os.UserHandle; import android.telecom.PhoneAccount; /** Loading Loading @@ -374,4 +375,10 @@ interface ITelecomService { * @see TelecomServiceImpl#setTestCallDiagnosticService */ void setTestCallDiagnosticService(in String packageName); /** * @see TelecomServiceImpl#isInSelfManagedCall */ boolean isInSelfManagedCall(String packageName, in UserHandle userHandle, String callingPackage); } Loading
telecomm/java/android/telecom/TelecomManager.java +27 −0 Original line number Diff line number Diff line Loading @@ -2600,6 +2600,33 @@ public class TelecomManager { return false; } /** * Determines whether there are any ongoing {@link PhoneAccount#CAPABILITY_SELF_MANAGED} * calls for a given {@code packageName} and {@code userHandle}. * * @param packageName the package name of the app to check calls for. * @param userHandle the user handle on which to check for calls. * @return {@code true} if there are ongoing calls, {@code false} otherwise. * @hide */ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isInSelfManagedCall(@NonNull String packageName, @NonNull UserHandle userHandle) { ITelecomService service = getTelecomService(); if (service != null) { try { return service.isInSelfManagedCall(packageName, userHandle, mContext.getOpPackageName()); } catch (RemoteException e) { Log.e(TAG, "RemoteException isInSelfManagedCall: " + e); e.rethrowFromSystemServer(); return false; } } else { throw new IllegalStateException("Telecom service is not present"); } } /** * Handles {@link Intent#ACTION_CALL} intents trampolined from UserCallActivity. * @param intent The {@link Intent#ACTION_CALL} intent to handle. Loading
telecomm/java/com/android/internal/telecom/ITelecomService.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.telecom.TelecomAnalytics; import android.telecom.PhoneAccountHandle; import android.net.Uri; import android.os.Bundle; import android.os.UserHandle; import android.telecom.PhoneAccount; /** Loading Loading @@ -374,4 +375,10 @@ interface ITelecomService { * @see TelecomServiceImpl#setTestCallDiagnosticService */ void setTestCallDiagnosticService(in String packageName); /** * @see TelecomServiceImpl#isInSelfManagedCall */ boolean isInSelfManagedCall(String packageName, in UserHandle userHandle, String callingPackage); }