Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7a7ec6d authored by Andrew Lee's avatar Andrew Lee Committed by Android (Google) Code Review
Browse files

Merge "Pass through video state when answering a call." into lmp-dev

parents 9c33953e 8da4c3c1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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();
+3 −2
Original line number Diff line number Diff line
@@ -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);
    }

    /**
+3 −1
Original line number Diff line number Diff line
@@ -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
+17 −6
Original line number Diff line number Diff line
@@ -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) {
+3 −2
Original line number Diff line number Diff line
@@ -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) {
        }
    }
Loading