From 36c62f3e3cc155e950de8b1a1f1109d38fb32d61 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Tue, 21 Oct 2014 18:36:39 -0700 Subject: [PATCH] Add an option to set the selected phone account as the default. (1/3) Modify the phoneAccountSelected method to support the option to set the selected phone account as the default for outgoing phone calls. Bug: 18078232 Change-Id: I2689bc9611366d521dfd3dc2086fd31eb6393876 --- telecomm/java/android/telecom/Call.java | 6 +++--- telecomm/java/android/telecom/InCallAdapter.java | 12 +++++++----- .../com/android/internal/telecom/IInCallAdapter.aidl | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index f9349639456d2..354fa2ee6498d 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -484,10 +484,10 @@ public final class Call { /** * Notifies this {@code Call} that an account has been selected and to proceed with placing - * an outgoing call. + * an outgoing call. Optionally sets this account as the default account. */ - public void phoneAccountSelected(PhoneAccountHandle accountHandle) { - mInCallAdapter.phoneAccountSelected(mTelecomCallId, accountHandle); + public void phoneAccountSelected(PhoneAccountHandle accountHandle, boolean setDefault) { + mInCallAdapter.phoneAccountSelected(mTelecomCallId, accountHandle, setDefault); } diff --git a/telecomm/java/android/telecom/InCallAdapter.java b/telecomm/java/android/telecom/InCallAdapter.java index fd3cf2e12668d..62b8dea946b49 100644 --- a/telecomm/java/android/telecom/InCallAdapter.java +++ b/telecomm/java/android/telecom/InCallAdapter.java @@ -189,14 +189,16 @@ public final class InCallAdapter { } /** - * Instructs Telecom to add a PhoneAccountHandle to the specified call + * Instructs Telecom to add a PhoneAccountHandle to the specified call. * - * @param callId The identifier of the call - * @param accountHandle The PhoneAccountHandle through which to place the call + * @param callId The identifier of the call. + * @param accountHandle The PhoneAccountHandle through which to place the call. + * @param setDefault {@code True} if this account should be set as the default for calls. */ - public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle) { + public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle, + boolean setDefault) { try { - mAdapter.phoneAccountSelected(callId, accountHandle); + mAdapter.phoneAccountSelected(callId, accountHandle, setDefault); } catch (RemoteException e) { } } diff --git a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl index 138a877cd843b..863fff29d5605 100644 --- a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl @@ -46,7 +46,8 @@ oneway interface IInCallAdapter { void postDialContinue(String callId, boolean proceed); - void phoneAccountSelected(String callId, in PhoneAccountHandle accountHandle); + void phoneAccountSelected(String callId, in PhoneAccountHandle accountHandle, + boolean setDefault); void conference(String callId, String otherCallId);