mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-27 14:40:22 +00:00
Fix crash when no remote participants are available when analyzing call result.
This commit is contained in:
committed by
jeffrey-signal
parent
fea836d20b
commit
2b4d5d74f2
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user