From f867800bd49c1021313d4f69623b1c168ab9a9b0 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sat, 18 Jul 2026 17:46:14 +0300 Subject: [PATCH] Allow speakerphone to be turned on also before call starts --- .../kotlin/com/tutpro/baresip/BaresipService.kt | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index d6ba200c..562db96c 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -1032,7 +1032,8 @@ class BaresipService: Service() { "call outgoing" -> { if (call!!.status.value == "transferring") break - speakerPhone = speakerPhoneAuto + if (speakerPhoneAuto) + speakerPhone = true stopMediaPlayer() setCallVolume() ensureCommunicationMode() @@ -1053,7 +1054,8 @@ class BaresipService: Service() { } "incoming call" -> { - speakerPhone = speakerPhoneAuto + if (speakerPhoneAuto) + speakerPhone = true val peerUri = ev[1] var blockedCall = false val toastMsg = if (Call.isAnyCallActive(this)) @@ -2753,17 +2755,6 @@ class BaresipService: Service() { } } else if (!Call.inCall() && currentMode == MODE_NORMAL) { - if (speakerPhone) { - Log.d(TAG, "Resetting speakerPhone UI state while idle") - speakerPhone = false - postServiceEvent( - ServiceEvent( - "speaker update,false", - arrayListOf(0L, 0L), - System.nanoTime() - ) - ) - } return }