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

Commit 8000845a authored by Ihab Awad's avatar Ihab Awad
Browse files

Support Conferences in Remote Connections

Bug: 16957997

Change-Id: I009924eac0f06a863b4c4c4148ecbcf27d220e14
parent bedebe30
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -616,7 +616,9 @@ final class Call implements CreateConnectionResponse {
    }

    @Override
    public void handleCreateConnectionSuccess(ParcelableConnection connection) {
    public void handleCreateConnectionSuccess(
            CallIdMapper idMapper,
            ParcelableConnection connection) {
        Log.v(this, "handleCreateConnectionSuccessful %s", connection);
        mCreateConnectionProcessor = null;
        setTargetPhoneAccount(connection.getPhoneAccount());
@@ -630,6 +632,11 @@ final class Call implements CreateConnectionResponse {
        setAudioModeIsVoip(connection.getAudioModeIsVoip());
        setStatusHints(connection.getStatusHints());

        mConferenceableCalls.clear();
        for (String id : connection.getConferenceableConnectionIds()) {
            mConferenceableCalls.add(idMapper.getCall(id));
        }

        if (mIsIncoming) {
            // We do not handle incoming calls immediately when they are verified by the connection
            // service. We allow the caller-info-query code to execute first so that we can read the
+2 −1
Original line number Diff line number Diff line
@@ -894,7 +894,8 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
        } else {
            // Successful connection
            if (mPendingResponses.containsKey(callId)) {
                mPendingResponses.remove(callId).handleCreateConnectionSuccess(connection);
                mPendingResponses.remove(callId)
                        .handleCreateConnectionSuccess(mCallIdMapper, connection);
            }
        }
    }
+4 −2
Original line number Diff line number Diff line
@@ -272,7 +272,9 @@ final class CreateConnectionProcessor {
        }

        @Override
        public void handleCreateConnectionSuccess(ParcelableConnection connection) {
        public void handleCreateConnectionSuccess(
                CallIdMapper idMapper,
                ParcelableConnection connection) {
            if (mResponse == null) {
                // Nobody is listening for this connection attempt any longer; ask the responsible
                // ConnectionService to tear down any resources associated with the call
@@ -280,7 +282,7 @@ final class CreateConnectionProcessor {
            } else {
                // Success -- share the good news and remember that we are no longer interested
                // in hearing about any more attempts
                mResponse.handleCreateConnectionSuccess(connection);
                mResponse.handleCreateConnectionSuccess(idMapper, connection);
                mResponse = null;
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -22,6 +22,6 @@ import android.telecomm.ParcelableConnection;
 * A callback for providing the result of creating a connection.
 */
interface CreateConnectionResponse {
    void handleCreateConnectionSuccess(ParcelableConnection connection);
    void handleCreateConnectionSuccess(CallIdMapper idMapper, ParcelableConnection connection);
    void handleCreateConnectionFailure(int code, String message);
}
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public class CallNotificationReceiver extends BroadcastReceiver {
    private void sendIncomingCallIntent(Context context, boolean isVideoCall) {
        PhoneAccountHandle phoneAccount = new PhoneAccountHandle(
                new ComponentName(context, TestConnectionService.class),
                CallServiceNotifier.CALL_PROVIDER_ID);
                CallServiceNotifier.SIM_SUBSCRIPTION_ID);

        // For the purposes of testing, indicate whether the incoming call is a video call by
        // stashing an indicator in the EXTRA_INCOMING_CALL_EXTRAS.
Loading