Show call full UI when group call is full.

This commit is contained in:
Cody Henthorne
2020-12-07 16:17:39 -05:00
committed by GitHub
parent 13616b9820
commit c00b0727e3
14 changed files with 178 additions and 57 deletions

View File

@@ -8,7 +8,7 @@ import com.annimon.stream.Stream;
import org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.recipients.RecipientId;
import org.thoughtcrime.securesms.ringrtc.CameraState;
import org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceState;
import java.util.List;
import java.util.Set;
@@ -94,29 +94,24 @@ public class WebRtcViewModel {
private final CallParticipant localParticipant;
private final List<CallParticipant> remoteParticipants;
private final Set<RecipientId> identityChangedRecipients;
private final long remoteDevicesCount;
private final Long participantLimit;
public WebRtcViewModel(@NonNull State state,
@NonNull GroupCallState groupState,
@NonNull Recipient recipient,
@NonNull CameraState localCameraState,
@Nullable BroadcastVideoSink localSink,
boolean isBluetoothAvailable,
boolean isMicrophoneEnabled,
boolean isRemoteVideoOffer,
long callConnectedTime,
@NonNull List<CallParticipant> remoteParticipants,
@NonNull Set<RecipientId> identityChangedRecipients)
{
this.state = state;
this.groupState = groupState;
this.recipient = recipient;
this.isBluetoothAvailable = isBluetoothAvailable;
this.isRemoteVideoOffer = isRemoteVideoOffer;
this.callConnectedTime = callConnectedTime;
this.remoteParticipants = remoteParticipants;
this.identityChangedRecipients = identityChangedRecipients;
localParticipant = CallParticipant.createLocal(localCameraState, localSink != null ? localSink : new BroadcastVideoSink(null), isMicrophoneEnabled);
public WebRtcViewModel(@NonNull WebRtcServiceState state) {
this.state = state.getCallInfoState().getCallState();
this.groupState = state.getCallInfoState().getGroupCallState();
this.recipient = state.getCallInfoState().getCallRecipient();
this.isRemoteVideoOffer = state.getCallSetupState().isRemoteVideoOffer();
this.isBluetoothAvailable = state.getLocalDeviceState().isBluetoothAvailable();
this.remoteParticipants = state.getCallInfoState().getRemoteCallParticipants();
this.identityChangedRecipients = state.getCallInfoState().getIdentityChangedRecipients();
this.callConnectedTime = state.getCallInfoState().getCallConnectedTime();
this.remoteDevicesCount = state.getCallInfoState().getRemoteDevicesCount();
this.participantLimit = state.getCallInfoState().getParticipantLimit();
this.localParticipant = CallParticipant.createLocal(state.getLocalDeviceState().getCameraState(),
state.getVideoState().getLocalSink() != null ? state.getVideoState().getLocalSink()
: new BroadcastVideoSink(null),
state.getLocalDeviceState().isMicrophoneEnabled());
}
public @NonNull State getState() {
@@ -159,6 +154,14 @@ public class WebRtcViewModel {
return identityChangedRecipients;
}
public long getRemoteDevicesCount() {
return remoteDevicesCount;
}
public @Nullable Long getParticipantLimit() {
return participantLimit;
}
@Override
public @NonNull String toString() {
return "WebRtcViewModel{" +
@@ -170,6 +173,8 @@ public class WebRtcViewModel {
", localParticipant=" + localParticipant +
", remoteParticipants=" + remoteParticipants +
", identityChangedRecipients=" + identityChangedRecipients +
", remoteDevicesCount=" + remoteDevicesCount +
", participantLimit=" + participantLimit +
'}';
}
}