Fix crash when no remote participants are available when analyzing call result.

This commit is contained in:
Alex Hart
2025-12-04 09:50:19 -04:00
committed by jeffrey-signal
parent fea836d20b
commit 2b4d5d74f2
2 changed files with 8 additions and 4 deletions

View File

@@ -28,8 +28,8 @@ object CallQuality {
)
@JvmStatic
fun handleOneToOneCallSummary(callSummary: CallSummary, isVideoCall: Boolean) {
val callType = if (isVideoCall) CallType.DIRECT_VIDEO else CallType.DIRECT_VOICE
fun handleOneToOneCallSummary(callSummary: CallSummary, hasRemoteVideoContent: Boolean) {
val callType = if (hasRemoteVideoContent) CallType.DIRECT_VIDEO else CallType.DIRECT_VOICE
handleCallSummary(callSummary, callType)
}

View File

@@ -614,11 +614,15 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
if (s.getCallInfoState().getGroupCall() != null) {
Log.i(TAG, "onCallEnded(): call_id: bypassing call summary handling for group call, this is handled in onEnded(groupCall, ...)");
} else {
boolean isRemoteVideoEnabled = Objects.requireNonNull(s.getCallInfoState().getRemoteCallParticipant(s.getCallInfoState().getCallRecipient())).isVideoEnabled();
boolean hasRemoteVideoContent = s.getCallInfoState()
.getRemoteCallParticipants()
.stream()
.anyMatch(participant -> participant.isVideoEnabled() || participant.isScreenSharing());
CameraState cameraState = s.getLocalDeviceState().getCameraState();
boolean isLocalVideoEnabled = cameraState.isEnabled() && cameraState.getCameraCount() > 0;
CallQuality.handleOneToOneCallSummary(summary, isRemoteVideoEnabled || isLocalVideoEnabled);
CallQuality.handleOneToOneCallSummary(summary, hasRemoteVideoContent || isLocalVideoEnabled);
}
switch (reason) {