Track possible SCO effects before starting the Android request

This commit is contained in:
evgeny committed 2026-10-29 13:34:23 +01:00
1 parent 48ab63a9d3
commit a6f8156564
2 files changed
+8 -5

No files matched your search

@@ -630,8 +630,8 @@ class CallAudioRouter {
private fun startBluetoothSco() {
scoOwned = true
am.startBluetoothSco()
scoFlagOwned = true
am.startBluetoothSco()
am.isBluetoothScoOn = true
}
@@ -63,7 +63,7 @@ class AudioManager {
check(name !in failures) { "audio operation failed: $name" }
}
var isBluetoothScoOn = false
set(value) { operation("sco=$value"); field = value }
set(value) { operation("sco=$value"); field = value; operation("sco after=$value") }
var isSpeakerphoneOn = false
set(value) { operation("speaker=$value"); field = value }
var mode = 0
@@ -106,9 +106,12 @@ class AudioManager {
operation("select=${device.id}")
if (!acceptCommunicationDevice || device !in availableCommunicationDevices) return false
communicationDevice = device
operation("select after=${device.id}")
return true
}
fun clearCommunicationDevice() { operation("clear"); communicationDevice = null }
fun startBluetoothSco() { operation("start sco") }
fun stopBluetoothSco() { operation("stop sco") }
var legacyScoStarted = false
private set
fun clearCommunicationDevice() { operation("clear"); communicationDevice = null; operation("clear after") }
fun startBluetoothSco() { operation("start sco"); legacyScoStarted = true; operation("start sco after") }
fun stopBluetoothSco() { operation("stop sco"); legacyScoStarted = false; operation("stop sco after") }
}