Closed LxzBUG closed 5 months ago
@LxzBUG This is correct behaviour. If user has selected the device, in your case speakerphone, when bluetooth device is connected it should not automatically change selected device to bluetooth. You should be able to change to bluetooth after receiving a callback in AudioDeviceChangeListener
and/or getting AudioSwitch.availableAudioDevices
list which should include now newly added bluetooth device and then setting it to route audio through bluetooth device AudioSwitch.selectDevice
This sentence means that I previously selected the speaker, so userSelectedDevice is the speaker. Then when I connect Bluetooth, selectedDevice keeps returning my previous setting, which prevents me from connecting Bluetooth.
` private fun enumerateDevices(bluetoothHeadsetName: String? = null) { // save off the old state and 'semi'-deep copy the list of audio devices val oldAudioDeviceState = AudioDeviceState(mutableAudioDevices.map { it }, selectedDevice) // update audio device list and selected device addAvailableAudioDevices(bluetoothHeadsetName)
`