Implement remote mute receive; Update to RingRTC v2.52.0

Co-authored-by: Alex Hart <alex@signal.org>
Co-authored-by: Cody Henthorne <cody@signal.org>
This commit is contained in:
Miriam Zimmerman
2025-04-25 10:06:47 -04:00
committed by Cody Henthorne
parent ed9a945f05
commit 3d7162cdd3
14 changed files with 191 additions and 10 deletions

View File

@@ -22,6 +22,7 @@ data class CallParticipant(
val isMediaKeysReceived: Boolean = true,
val addedToCallTime: Long = 0,
val isScreenSharing: Boolean = false,
val remotelyMutedBy: Recipient? = null,
private val deviceOrdinal: DeviceOrdinal = DeviceOrdinal.PRIMARY
) {
val cameraDirection: CameraState.Direction
@@ -68,7 +69,7 @@ data class CallParticipant(
}
fun withAudioEnabled(audioEnabled: Boolean): CallParticipant {
return copy(isMicrophoneEnabled = audioEnabled)
return copy(isMicrophoneEnabled = audioEnabled, remotelyMutedBy = if (audioEnabled) null else remotelyMutedBy)
}
fun withVideoEnabled(videoEnabled: Boolean): CallParticipant {
@@ -83,8 +84,12 @@ data class CallParticipant(
return copy(handRaisedTimestamp = timestamp)
}
fun withRemotelyMutedBy(source: Recipient): CallParticipant {
return copy(remotelyMutedBy = source)
}
override fun toString(): String {
return "CallParticipant(callParticipantId=$callParticipantId, isForwardingVideo=$isForwardingVideo, isVideoEnabled=$isVideoEnabled, isMicrophoneEnabled=$isMicrophoneEnabled, handRaisedTimestamp=$handRaisedTimestamp, isMediaKeysReceived=$isMediaKeysReceived, isScreenSharing=$isScreenSharing)"
return "CallParticipant(callParticipantId=$callParticipantId, isForwardingVideo=$isForwardingVideo, isVideoEnabled=$isVideoEnabled, isMicrophoneEnabled=$isMicrophoneEnabled, handRaisedTimestamp=$handRaisedTimestamp, isMediaKeysReceived=$isMediaKeysReceived, isScreenSharing=$isScreenSharing, remotelyMutedBy=$remotelyMutedBy)"
}
enum class DeviceOrdinal {

View File

@@ -129,6 +129,8 @@ class WebRtcViewModel(state: WebRtcServiceState) {
state.localDeviceState.handRaisedTimestamp
)
val remoteMutedBy: CallParticipant? = state.localDeviceState.remoteMutedBy
val isCellularConnection: Boolean = when (state.localDeviceState.networkConnectionType) {
PeerConnection.AdapterType.UNKNOWN,
PeerConnection.AdapterType.ETHERNET,
@@ -166,7 +168,8 @@ class WebRtcViewModel(state: WebRtcServiceState) {
activeDevice=$activeDevice,
availableDevices=$availableDevices,
bluetoothPermissionDenied=$bluetoothPermissionDenied,
ringGroup=$ringGroup
ringGroup=$ringGroup,
remoteMutedBy=$remoteMutedBy
}
""".trimIndent()
}
@@ -197,6 +200,7 @@ class WebRtcViewModel(state: WebRtcServiceState) {
if (availableDevices != previousEvent.availableDevices) builder.append(" availableDevices=$availableDevices\n")
if (bluetoothPermissionDenied != previousEvent.bluetoothPermissionDenied) builder.append(" bluetoothPermissionDenied=$bluetoothPermissionDenied\n")
if (ringGroup != previousEvent.ringGroup) builder.append(" ringGroup=$ringGroup\n")
if (remoteMutedBy != previousEvent.remoteMutedBy) builder.append(" remoteMutedBy=$remoteMutedBy\n")
if (builder.isEmpty()) {
"<no change>"