From 50e3506533478fa273cbc92c2919470d1889f1ed Mon Sep 17 00:00:00 2001 From: Ihab Awad Date: Tue, 30 Sep 2014 09:17:03 -0700 Subject: Refine implementation of GSM conferences (1/3) Bug: 17684223 Change-Id: I05d05b594803ea2c1da4247111b70ad5f870ac46 --- .../java/android/telecom/ConnectionService.java | 28 ++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'telecomm/java/android/telecom/ConnectionService.java') diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index ed9251b..efd311e 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -360,6 +360,14 @@ public abstract class ConnectionService extends Service { } @Override + public void onConferenceableConnectionsChanged( + Conference conference, List conferenceableConnections) { + mAdapter.setConferenceableConnections( + mIdByConference.get(conference), + createConnectionIdList(conferenceableConnections)); + } + + @Override public void onDestroyed(Conference conference) { removeConference(conference); } @@ -638,19 +646,25 @@ public abstract class ConnectionService extends Service { private void conference(String callId1, String callId2) { Log.d(this, "conference %s, %s", callId1, callId2); - Connection connection1 = findConnectionForAction(callId1, "conference"); - if (connection1 == getNullConnection()) { - Log.w(this, "Connection1 missing in conference request %s.", callId1); - return; - } - Connection connection2 = findConnectionForAction(callId2, "conference"); if (connection2 == getNullConnection()) { Log.w(this, "Connection2 missing in conference request %s.", callId2); return; } - onConference(connection1, connection2); + Connection connection1 = findConnectionForAction(callId1, "conference"); + if (connection1 == getNullConnection()) { + Conference conference1 = findConferenceForAction(callId1, "addConnection"); + if (conference1 == getNullConference()) { + Log.w(this, + "Connection1 or Conference1 missing in conference request %s.", + callId1); + } else { + conference1.onMerge(connection2); + } + } else { + onConference(connection1, connection2); + } } private void splitFromConference(String callId) { -- cgit v1.1