diff options
Diffstat (limited to 'telecomm')
7 files changed, 30 insertions, 15 deletions
diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java index 5a41acb..3b8b87b 100644 --- a/telecomm/java/android/telecomm/Call.java +++ b/telecomm/java/android/telecomm/Call.java @@ -342,9 +342,10 @@ public final class Call { /** * Instructs this {@link #STATE_RINGING} {@code Call} to answer. + * @param videoState The video state in which to answer the call. */ - public void answer() { - mInCallAdapter.answerCall(mTelecommCallId); + public void answer(int videoState) { + mInCallAdapter.answerCall(mTelecommCallId, videoState); } /** diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java index db834a4..130364f 100644 --- a/telecomm/java/android/telecomm/Connection.java +++ b/telecomm/java/android/telecomm/Connection.java @@ -486,8 +486,10 @@ public abstract class Connection { /** * Notifies this Connection, which is in {@link State#RINGING}, of * a request to accept. + * + * @param videoState The video state in which to answer the call. */ - protected void onAnswer() {} + protected void onAnswer(int videoState) {} /** * Notifies this Connection, which is in {@link State#RINGING}, of diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java index 2a6804b..5855470 100644 --- a/telecomm/java/android/telecomm/ConnectionService.java +++ b/telecomm/java/android/telecomm/ConnectionService.java @@ -121,8 +121,11 @@ public abstract class ConnectionService extends Service { } @Override - public void answer(String callId) { - mHandler.obtainMessage(MSG_ANSWER, callId).sendToTarget(); + public void answer(String callId, int videoState) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = videoState; + mHandler.obtainMessage(MSG_ANSWER, args).sendToTarget(); } @Override @@ -209,9 +212,17 @@ public abstract class ConnectionService extends Service { case MSG_ABORT: abort((String) msg.obj); break; - case MSG_ANSWER: - answer((String) msg.obj); + case MSG_ANSWER: { + SomeArgs args = (SomeArgs) msg.obj; + try { + String callId = (String) args.arg1; + int videoState = (int) args.arg2; + answer(callId, videoState); + } finally { + args.recycle(); + } break; + } case MSG_REJECT: reject((String) msg.obj); break; @@ -428,9 +439,9 @@ public abstract class ConnectionService extends Service { findConnectionForAction(callId, "abort").onAbort(); } - private void answer(String callId) { + private void answer(String callId, int videoState) { Log.d(this, "answer %s", callId); - findConnectionForAction(callId, "answer").onAnswer(); + findConnectionForAction(callId, "answer").onAnswer(videoState); } private void reject(String callId) { diff --git a/telecomm/java/android/telecomm/InCallAdapter.java b/telecomm/java/android/telecomm/InCallAdapter.java index f228046..c872c58 100644 --- a/telecomm/java/android/telecomm/InCallAdapter.java +++ b/telecomm/java/android/telecomm/InCallAdapter.java @@ -45,10 +45,11 @@ public final class InCallAdapter { * Instructs Telecomm to answer the specified call. * * @param callId The identifier of the call to answer. + * @param videoState The video state in which to answer the call. */ - public void answerCall(String callId) { + public void answerCall(String callId, int videoState) { try { - mAdapter.answerCall(callId); + mAdapter.answerCall(callId, videoState); } catch (RemoteException e) { } } diff --git a/telecomm/java/android/telecomm/RemoteConnection.java b/telecomm/java/android/telecomm/RemoteConnection.java index 3475305..5d8579e 100644 --- a/telecomm/java/android/telecomm/RemoteConnection.java +++ b/telecomm/java/android/telecomm/RemoteConnection.java @@ -129,10 +129,10 @@ public final class RemoteConnection { } } - public void answer() { + public void answer(int videoState) { try { if (mConnected) { - mConnectionService.answer(mConnectionId); + mConnectionService.answer(mConnectionId, videoState); } } catch (RemoteException ignored) { } diff --git a/telecomm/java/com/android/internal/telecomm/IConnectionService.aidl b/telecomm/java/com/android/internal/telecomm/IConnectionService.aidl index 9360219..05375c9 100644 --- a/telecomm/java/com/android/internal/telecomm/IConnectionService.aidl +++ b/telecomm/java/com/android/internal/telecomm/IConnectionService.aidl @@ -36,7 +36,7 @@ oneway interface IConnectionService { void abort(String callId); - void answer(String callId); + void answer(String callId, int videoState); void reject(String callId); diff --git a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl index b5b239b..aca8c0a 100644 --- a/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl +++ b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl @@ -27,7 +27,7 @@ import android.telecomm.PhoneAccount; * {@hide} */ oneway interface IInCallAdapter { - void answerCall(String callId); + void answerCall(String callId, int videoState); void rejectCall(String callId, boolean rejectWithMessage, String textMessage); |