Add a new call direction parameter to conferences for multiparty

1) Refactor ParcelableConference - too many optional params
2) Add a new call direction parameter for external multiparty
call scenarios, where a conference is assigned a direction.

Bug: 153595501
Test: atest TelecomUnitTests TeleServiceTests
Change-Id: Icb576a07b9a7a81e228babfea53474be83da7593
This commit is contained in:
Brad Ebinger
2020-04-09 15:30:57 -07:00
parent 31774ae752
commit 43e026594e
3 changed files with 175 additions and 82 deletions

View File

@@ -1865,25 +1865,23 @@ public abstract class ConnectionService extends Service {
mConferenceById.put(callId, conference);
mIdByConference.put(conference, callId);
conference.addListener(mConferenceListener);
ParcelableConference parcelableConference = new ParcelableConference(
request.getAccountHandle(),
conference.getState(),
conference.getConnectionCapabilities(),
conference.getConnectionProperties(),
Collections.<String>emptyList(), //connectionIds
conference.getVideoProvider() == null ?
null : conference.getVideoProvider().getInterface(),
conference.getVideoState(),
conference.getConnectTimeMillis(),
conference.getConnectionStartElapsedRealtimeMillis(),
conference.getStatusHints(),
conference.getExtras(),
conference.getAddress(),
conference.getAddressPresentation(),
conference.getCallerDisplayName(),
conference.getCallerDisplayNamePresentation(),
conference.getDisconnectCause(),
conference.isRingbackRequested());
ParcelableConference parcelableConference = new ParcelableConference.Builder(
request.getAccountHandle(), conference.getState())
.setConnectionCapabilities(conference.getConnectionCapabilities())
.setConnectionProperties(conference.getConnectionProperties())
.setVideoAttributes(conference.getVideoProvider() == null
? null : conference.getVideoProvider().getInterface(),
conference.getVideoState())
.setConnectTimeMillis(conference.getConnectTimeMillis(),
conference.getConnectionStartElapsedRealtimeMillis())
.setStatusHints(conference.getStatusHints())
.setExtras(conference.getExtras())
.setAddress(conference.getAddress(), conference.getAddressPresentation())
.setCallerDisplayName(conference.getCallerDisplayName(),
conference.getCallerDisplayNamePresentation())
.setDisconnectCause(conference.getDisconnectCause())
.setRingbackRequested(conference.isRingbackRequested())
.build();
if (conference.getState() != Connection.STATE_DISCONNECTED) {
conference.setTelecomCallId(callId);
mAdapter.setVideoProvider(callId, conference.getVideoProvider());
@@ -2484,23 +2482,25 @@ public abstract class ConnectionService extends Service {
}
}
conference.setTelecomCallId(id);
ParcelableConference parcelableConference = new ParcelableConference(
conference.getPhoneAccountHandle(),
conference.getState(),
conference.getConnectionCapabilities(),
conference.getConnectionProperties(),
connectionIds,
conference.getVideoProvider() == null ?
null : conference.getVideoProvider().getInterface(),
conference.getVideoState(),
conference.getConnectTimeMillis(),
conference.getConnectionStartElapsedRealtimeMillis(),
conference.getStatusHints(),
conference.getExtras(),
conference.getAddress(),
conference.getAddressPresentation(),
conference.getCallerDisplayName(),
conference.getCallerDisplayNamePresentation());
ParcelableConference parcelableConference = new ParcelableConference.Builder(
conference.getPhoneAccountHandle(), conference.getState())
.setConnectionCapabilities(conference.getConnectionCapabilities())
.setConnectionProperties(conference.getConnectionProperties())
.setConnectionIds(connectionIds)
.setVideoAttributes(conference.getVideoProvider() == null
? null : conference.getVideoProvider().getInterface(),
conference.getVideoState())
.setConnectTimeMillis(conference.getConnectTimeMillis(),
conference.getConnectionStartElapsedRealtimeMillis())
.setStatusHints(conference.getStatusHints())
.setExtras(conference.getExtras())
.setAddress(conference.getAddress(), conference.getAddressPresentation())
.setCallerDisplayName(conference.getCallerDisplayName(),
conference.getCallerDisplayNamePresentation())
.setDisconnectCause(conference.getDisconnectCause())
.setRingbackRequested(conference.isRingbackRequested())
.setCallDirection(conference.getCallDirection())
.build();
mAdapter.addConferenceCall(id, parcelableConference);
mAdapter.setVideoProvider(id, conference.getVideoProvider());