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

Commit f7c8b58e authored by Santos Cordon's avatar Santos Cordon Committed by Android (Google) Code Review
Browse files

Merge "Updating APIs for CDMA conference call support." into lmp-dev

parents e9921370 a4868042
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -28231,17 +28231,19 @@ package android.telecomm {
  public abstract class Conference {
    ctor public Conference(android.telecomm.PhoneAccountHandle);
    method public boolean addConnection(android.telecomm.Connection);
    method public void destroy();
    method public final boolean addConnection(android.telecomm.Connection);
    method public final void destroy();
    method public final int getCapabilities();
    method public final java.util.List<android.telecomm.Connection> getConnections();
    method public final android.telecomm.PhoneAccountHandle getPhoneAccount();
    method public final int getState();
    method public void onDisconnect();
    method public void onHold();
    method public void onMerge();
    method public void onSeparate(android.telecomm.Connection);
    method public void onSwap();
    method public void onUnhold();
    method public void removeConnection(android.telecomm.Connection);
    method public final void removeConnection(android.telecomm.Connection);
    method public final void setActive();
    method public final void setCapabilities(int);
    method public final void setDisconnected(int, java.lang.String);
@@ -28392,13 +28394,13 @@ package android.telecomm {
    method public static java.lang.String toString(int);
    field public static final int ADD_CALL = 16; // 0x10
    field public static final int ALL = 255; // 0xff
    field public static final int GENERIC_CONFERENCE = 128; // 0x80
    field public static final int HOLD = 1; // 0x1
    field public static final int MERGE_CALLS = 4; // 0x4
    field public static final int MANAGE_CONFERENCE = 128; // 0x80
    field public static final int MERGE_CONFERENCE = 4; // 0x4
    field public static final int MUTE = 64; // 0x40
    field public static final int RESPOND_VIA_TEXT = 32; // 0x20
    field public static final int SUPPORT_HOLD = 2; // 0x2
    field public static final int SWAP_CALLS = 8; // 0x8
    field public static final int SWAP_CONFERENCE = 8; // 0x8
  }
  public class PropertyPresentation {
+14 −0
Original line number Diff line number Diff line
@@ -516,6 +516,20 @@ public final class Call {
        mInCallAdapter.splitFromConference(mTelecommCallId);
    }

    /**
     * Merges the calls within this conference. See {@link PhoneCapabilities#MERGE_CONFERENCE}.
     */
    public void mergeConference() {
        mInCallAdapter.mergeConference(mTelecommCallId);
    }

    /**
     * Swaps the calls within this conference. See {@link PhoneCapabilities#SWAP_CONFERENCE}.
     */
    public void swapConference() {
        mInCallAdapter.swapConference(mTelecommCallId);
    }

    /**
     * Obtains the parent of this {@code Call} in a conference, if any.
     *
+15 −3
Original line number Diff line number Diff line
@@ -92,6 +92,18 @@ public abstract class Conference {
     */
    public void onUnhold() {}

    /**
     * Invoked when the child calls should be merged. Only invoked if the conference contains the
     * capability {@link PhoneCapabilities#MERGE_CONFERENCE}.
     */
    public void onMerge() {}

    /**
     * Invoked when the child calls should be swapped. Only invoked if the conference contains the
     * capability {@link PhoneCapabilities#SWAP_CONFERENCE}.
     */
    public void onSwap() {}

    /**
     * Sets state to be on hold.
     */
@@ -141,7 +153,7 @@ public abstract class Conference {
     * @param connection The connection to add.
     * @return True if the connection was successfully added.
     */
    public boolean addConnection(Connection connection) {
    public final boolean addConnection(Connection connection) {
        if (connection != null && !mChildConnections.contains(connection)) {
            if (connection.setConference(this)) {
                mChildConnections.add(connection);
@@ -160,7 +172,7 @@ public abstract class Conference {
     * @param connection The connection to remove.
     * @return True if the connection was successfully removed.
     */
    public void removeConnection(Connection connection) {
    public final void removeConnection(Connection connection) {
        Log.d(this, "removing %s from %s", connection, mChildConnections);
        if (connection != null && mChildConnections.remove(connection)) {
            connection.resetConference();
@@ -173,7 +185,7 @@ public abstract class Conference {
    /**
     * Tears down the conference object and any of it's current connections.
     */
    public void destroy() {
    public final void destroy() {
        Log.d(this, "destroying conference : %s", this);
        // Tear down the children.
        for (Connection connection : mChildConnections) {
+1 −1
Original line number Diff line number Diff line
@@ -1068,10 +1068,10 @@ public abstract class Connection {
        if (mState != state) {
            Log.d(this, "setState: %s", stateToString(state));
            mState = state;
            onSetState(state);
            for (Listener l : mListeners) {
                l.onStateChanged(this, state);
            }
            onSetState(state);
        }
    }

+34 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ public abstract class ConnectionService extends Service {
    private static final int MSG_ON_PHONE_ACCOUNT_CLICKED = 15;
    private static final int MSG_REMOVE_CONNECTION_SERVICE_ADAPTER = 16;
    private static final int MSG_ANSWER_VIDEO = 17;
    private static final int MSG_MERGE_CONFERENCE = 18;
    private static final int MSG_SWAP_CONFERENCE = 19;

    private static Connection sNullConnection;

@@ -181,6 +183,16 @@ public abstract class ConnectionService extends Service {
            mHandler.obtainMessage(MSG_SPLIT_FROM_CONFERENCE, callId).sendToTarget();
        }

        @Override
        public void mergeConference(String callId) {
            mHandler.obtainMessage(MSG_MERGE_CONFERENCE, callId).sendToTarget();
        }

        @Override
        public void swapConference(String callId) {
            mHandler.obtainMessage(MSG_SWAP_CONFERENCE, callId).sendToTarget();
        }

        @Override
        public void onPostDialContinue(String callId, boolean proceed) {
            SomeArgs args = SomeArgs.obtain();
@@ -298,6 +310,12 @@ public abstract class ConnectionService extends Service {
                case MSG_SPLIT_FROM_CONFERENCE:
                    splitFromConference((String) msg.obj);
                    break;
                case MSG_MERGE_CONFERENCE:
                    mergeConference((String) msg.obj);
                    break;
                case MSG_SWAP_CONFERENCE:
                    swapConference((String) msg.obj);
                    break;
                case MSG_ON_POST_DIAL_CONTINUE: {
                    SomeArgs args = (SomeArgs) msg.obj;
                    try {
@@ -639,6 +657,22 @@ public abstract class ConnectionService extends Service {
        }
    }

    private void mergeConference(String callId) {
        Log.d(this, "mergeConference(%s)", callId);
        Conference conference = findConferenceForAction(callId, "mergeConference");
        if (conference != null) {
            conference.onMerge();
        }
    }

    private void swapConference(String callId) {
        Log.d(this, "swapConference(%s)", callId);
        Conference conference = findConferenceForAction(callId, "swapConference");
        if (conference != null) {
            conference.onSwap();
        }
    }

    private void onPostDialContinue(String callId, boolean proceed) {
        Log.d(this, "onPostDialContinue(%s)", callId);
        findConnectionForAction(callId, "stopDtmfTone").onPostDialContinue(proceed);
Loading