Allow speakerphone to be turned on also before call starts

This commit is contained in:
Juha Heinanen
2026-07-18 17:46:14 +03:00
parent e40be4d97c
commit f867800bd4

View File

@ -1032,7 +1032,8 @@ class BaresipService: Service() {
"call outgoing" -> { "call outgoing" -> {
if (call!!.status.value == "transferring") if (call!!.status.value == "transferring")
break break
speakerPhone = speakerPhoneAuto if (speakerPhoneAuto)
speakerPhone = true
stopMediaPlayer() stopMediaPlayer()
setCallVolume() setCallVolume()
ensureCommunicationMode() ensureCommunicationMode()
@ -1053,7 +1054,8 @@ class BaresipService: Service() {
} }
"incoming call" -> { "incoming call" -> {
speakerPhone = speakerPhoneAuto if (speakerPhoneAuto)
speakerPhone = true
val peerUri = ev[1] val peerUri = ev[1]
var blockedCall = false var blockedCall = false
val toastMsg = if (Call.isAnyCallActive(this)) val toastMsg = if (Call.isAnyCallActive(this))
@ -2753,17 +2755,6 @@ class BaresipService: Service() {
} }
} }
else if (!Call.inCall() && currentMode == MODE_NORMAL) { 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 return
} }