From 2f79bfb075e8487aba614d667f16613570f2ff88 Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Wed, 24 Apr 2024 00:47:15 +0700 Subject: [PATCH] android: current audio device will be set in init step (#4071) --- .../chat/simplex/common/views/call/CallAudioDeviceManager.kt | 1 + .../kotlin/chat/simplex/common/views/call/CallView.android.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/call/CallAudioDeviceManager.kt b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/call/CallAudioDeviceManager.kt index d9562100cf..bada85746f 100644 --- a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/call/CallAudioDeviceManager.kt +++ b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/call/CallAudioDeviceManager.kt @@ -65,6 +65,7 @@ class PostSCallAudioDeviceManager: CallAudioDeviceManagerInterface { override fun start() { am.mode = AudioManager.MODE_IN_COMMUNICATION + currentDevice.value = am.communicationDevice am.registerAudioDeviceCallback(audioCallback, null) am.addOnCommunicationDeviceChangedListener(Executors.newSingleThreadExecutor(), listener) } diff --git a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/call/CallView.android.kt b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/call/CallView.android.kt index f9fb81a3ef..f676772714 100644 --- a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/call/CallView.android.kt +++ b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/call/CallView.android.kt @@ -94,8 +94,8 @@ actual fun ActiveCallView() { if (wasConnected.value) { CallSoundsPlayer.vibrate() } - dropAudioManagerOverrides() callAudioDeviceManager.stop() + dropAudioManagerOverrides() if (proximityLock?.isHeld == true) { proximityLock.release() }