diff options
| author | Andrew Lee <anwlee@google.com> | 2014-07-17 21:30:04 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-07-17 21:30:04 +0000 |
| commit | 7b90dff9ba41101dcea015586daae2dce42eab5c (patch) | |
| tree | 8946ba5be3bbaf9b263d4651e9bd2b683edf0394 | |
| parent | 718e174503355ed370c468e2b9589dd993dc61ed (diff) | |
| parent | 8198cb7deb40fb4eee2ef0c674d2ef51d758a960 (diff) | |
| download | frameworks_base-7b90dff9ba41101dcea015586daae2dce42eab5c.zip frameworks_base-7b90dff9ba41101dcea015586daae2dce42eab5c.tar.gz frameworks_base-7b90dff9ba41101dcea015586daae2dce42eab5c.tar.bz2 | |
am 3441f3c5: am 9eb532f5: Merge "Pass through video state when answering a call." into lmp-dev
* commit '3441f3c5da64c441f1fe9c4be06e3aeac87b9f5f':
Pass through video state when answering a call.
8 files changed, 34 insertions, 19 deletions
diff --git a/api/current.txt b/api/current.txt index dbf28db..633d0b2 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28027,7 +28027,7 @@ package android.telecomm { public final class Call { method public void addListener(android.telecomm.Call.Listener); - method public void answer(); + method public void answer(int); method public void conference(); method public void disconnect(); method public android.telecomm.RemoteCallVideoProvider getCallVideoProvider(); @@ -28195,7 +28195,7 @@ package android.telecomm { method public final boolean isConferenceConnection(); method public final boolean isRequestingRingback(); method protected void onAbort(); - method protected void onAnswer(); + method protected void onAnswer(int); method protected void onChildrenChanged(java.util.List<android.telecomm.Connection>); method protected void onDisconnect(); method protected void onHold(); @@ -28282,7 +28282,7 @@ package android.telecomm { } public final class InCallAdapter { - method public void answerCall(java.lang.String); + method public void answerCall(java.lang.String, int); method public void disconnectCall(java.lang.String); method public void holdCall(java.lang.String); method public void mute(boolean); @@ -28396,7 +28396,7 @@ package android.telecomm { public final class RemoteConnection { method public void abort(); method public void addListener(android.telecomm.RemoteConnection.Listener); - method public void answer(); + method public void answer(int); method public void disconnect(); method public boolean getAudioModeIsVoip(); method public int getCallCapabilities(); diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java index cbc8339..930336f 100644 --- a/telecomm/java/android/telecomm/Call.java +++ b/telecomm/java/android/telecomm/Call.java @@ -354,9 +354,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); |
