From 7c4c348f8cba0d38e26dca27065622551e1a3532 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 25 Mar 2022 09:23:15 +0100 Subject: [PATCH] Fixed speaker turning on automatically when in video conference with local video disabled --- .../activities/voip/viewmodels/ControlsViewModel.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/linphone/activities/voip/viewmodels/ControlsViewModel.kt b/app/src/main/java/org/linphone/activities/voip/viewmodels/ControlsViewModel.kt index 4a438516e..7218cb3e7 100644 --- a/app/src/main/java/org/linphone/activities/voip/viewmodels/ControlsViewModel.kt +++ b/app/src/main/java/org/linphone/activities/voip/viewmodels/ControlsViewModel.kt @@ -435,8 +435,11 @@ class ControlsViewModel : ViewModel() { } private fun updateVideoEnabled() { - val enabled = coreContext.core.currentCall?.currentParams?.isVideoEnabled ?: false - if (enabled && isVideoEnabled.value == false) { + val currentCall = coreContext.core.currentCall + val enabled = currentCall?.currentParams?.isVideoEnabled ?: false + // Prevent speaker to turn on each time a participant joins a video conference + val isConference = currentCall?.conference != null + if (enabled && !isConference && isVideoEnabled.value == false) { Log.i("[Call Controls] Video is being turned on") if (corePreferences.routeAudioToSpeakerWhenVideoIsEnabled) { // Do not turn speaker on when video is enabled if headset or bluetooth is used