Added setting of isBluetoothScoOn true/false before/after sco is connected/disconnected

This commit is contained in:
Juha Heinanen
2023-04-04 16:55:33 +03:00
parent f09a7b9b15
commit de8d0f01ef
2 changed files with 6 additions and 3 deletions

View File

@ -1634,6 +1634,7 @@ class BaresipService: Service() {
private fun startBluetoothSco(am: AudioManager, delay: Long, count: Int) {
Log.d(TAG, "Starting Bluetooth SCO at count $count")
Handler(Looper.getMainLooper()).postDelayed({
am.isBluetoothScoOn = true
if (VERSION.SDK_INT < 31) {
am.startBluetoothSco()
} else {
@ -1651,6 +1652,7 @@ class BaresipService: Service() {
am.stopBluetoothSco()
else
am.clearCommunicationDevice()
am.isBluetoothScoOn = false
}, 100)
}
@ -1663,4 +1665,5 @@ class BaresipService: Service() {
libraryLoaded = true
}
}
}

View File

@ -980,9 +980,9 @@ object Utils {
Log.d(TAG, "Current com dev/mode $current/${am.mode}")
for (device in am.availableCommunicationDevices)
if (device.type == type) {
am.setCommunicationDevice(device)
break
}
am.setCommunicationDevice(device)
break
}
Log.d(TAG, "New com dev/mode ${am.communicationDevice!!.type}/${am.mode}")
}