Added setting of isBluetoothScoOn true/false before/after sco is connected/disconnected
This commit is contained in:
@@ -1634,6 +1634,7 @@ class BaresipService: Service() {
|
|||||||
private fun startBluetoothSco(am: AudioManager, delay: Long, count: Int) {
|
private fun startBluetoothSco(am: AudioManager, delay: Long, count: Int) {
|
||||||
Log.d(TAG, "Starting Bluetooth SCO at count $count")
|
Log.d(TAG, "Starting Bluetooth SCO at count $count")
|
||||||
Handler(Looper.getMainLooper()).postDelayed({
|
Handler(Looper.getMainLooper()).postDelayed({
|
||||||
|
am.isBluetoothScoOn = true
|
||||||
if (VERSION.SDK_INT < 31) {
|
if (VERSION.SDK_INT < 31) {
|
||||||
am.startBluetoothSco()
|
am.startBluetoothSco()
|
||||||
} else {
|
} else {
|
||||||
@@ -1651,6 +1652,7 @@ class BaresipService: Service() {
|
|||||||
am.stopBluetoothSco()
|
am.stopBluetoothSco()
|
||||||
else
|
else
|
||||||
am.clearCommunicationDevice()
|
am.clearCommunicationDevice()
|
||||||
|
am.isBluetoothScoOn = false
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1663,4 +1665,5 @@ class BaresipService: Service() {
|
|||||||
libraryLoaded = true
|
libraryLoaded = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -980,9 +980,9 @@ object Utils {
|
|||||||
Log.d(TAG, "Current com dev/mode $current/${am.mode}")
|
Log.d(TAG, "Current com dev/mode $current/${am.mode}")
|
||||||
for (device in am.availableCommunicationDevices)
|
for (device in am.availableCommunicationDevices)
|
||||||
if (device.type == type) {
|
if (device.type == type) {
|
||||||
am.setCommunicationDevice(device)
|
am.setCommunicationDevice(device)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
Log.d(TAG, "New com dev/mode ${am.communicationDevice!!.type}/${am.mode}")
|
Log.d(TAG, "New com dev/mode ${am.communicationDevice!!.type}/${am.mode}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user