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

Commit 0b66e1c8 authored by Sailesh Nepal's avatar Sailesh Nepal
Browse files

Don't create conferences with invalid calls

When a remote conference was created
ConnectionServiceWrapper would actually create 2
conferences. One for the remote connection service with no
valid calls one for the real connection service with valid
calls.

When the conference was destroyed the remove call on the
remote connection serivce would trigger a unbind causing
android.telecom.ConnectionService to end call connections
for that service.

Fix was to ensure that we only create conferences with
valid calls.

Bug: 17632595
Change-Id: I3f339120dde8eb07ee7e40a26d3a37f1dbd1409e
parent 77658c4d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -198,6 +198,21 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
                        }
                        ParcelableConference parcelableConference =
                                (ParcelableConference) args.arg2;

                        // Make sure that there's at least one valid call. For remote connections
                        // we'll get a add conference msg from both the remote connection service
                        // and from the real connection service.
                        boolean hasValidCalls = false;
                        for (String callId : parcelableConference.getConnectionIds()) {
                            if (mCallIdMapper.getCall(callId) != null) {
                                hasValidCalls = true;
                            }
                        }
                        if (!hasValidCalls) {
                            Log.d(this, "Attempting to add a conference with no valid calls");
                            break;
                        }

                        // need to create a new Call
                        Call conferenceCall = mCallsManager.createConferenceCall(
                                null, parcelableConference);
@@ -426,7 +441,6 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
            logIncoming("removeCall %s", callId);
            if (mCallIdMapper.isValidCallId(callId) || mCallIdMapper.isValidConferenceId(callId)) {
                mHandler.obtainMessage(MSG_REMOVE_CALL, callId).sendToTarget();
                mHandler.obtainMessage(MSG_REMOVE_CALL, callId);
            }
        }