From c37445cb4ec3ef7e9fead44eb27c1053019773de Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Fri, 28 Sep 2018 16:16:20 -0700 Subject: [PATCH] Add handleCallIntent method in TelecomManager. This is an @hide method usable only from within Telecom itself in order to trampoline an ACTION_CALL intent from the UserCallActivity to Telecom's system service. Bug: 116719392 Test: Verify that calls initiated via CALL intent no longer get rebroadcast and are instead sent directly to Telecom. Change-Id: Ie765631bef8329a8ed12723d9c037a44b4f80882 --- .../java/android/telecom/TelecomManager.java | 16 ++++++++++++++++ .../internal/telecom/ITelecomService.aidl | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 8c37a21afa503..d33a537f21942 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -1905,6 +1905,22 @@ public class TelecomManager { return false; } + /** + * Handles {@link Intent#ACTION_CALL} intents trampolined from UserCallActivity. + * @param intent The {@link Intent#ACTION_CALL} intent to handle. + * @hide + */ + public void handleCallIntent(Intent intent) { + try { + if (isServiceConnected()) { + getTelecomService().handleCallIntent(intent); + } + } catch (RemoteException e) { + Log.e(TAG, "RemoteException handleCallIntent: " + e); + } + + } + private ITelecomService getTelecomService() { if (mTelecomServiceOverride != null) { return mTelecomServiceOverride; diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl index 38247bc80e5c1..df7d6832833ad 100644 --- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl +++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl @@ -284,4 +284,9 @@ interface ITelecomService { * @see TelecomServiceImpl#isInEmergencyCall */ boolean isInEmergencyCall(); + + /** + * @see TelecomServiceImpl#handleCallIntent + */ + void handleCallIntent(in Intent intent); }