Open tech-ajit-mob opened 1 week ago
Hi Team, Have you had a chance to review this issue?
Hi @tech-ajit-mob to clarify, in the initial steps 1-5, bluetooth is connected, but does not appear in the list of available devices, only after reconnecting the BT device it becomes listed? And then when you make a second call (while bluetooth is connected and active) then the BT device is missing in the device list again, is that correct?
Are you using BluetoothHeadsetConnectionListener to see bluetooth related callbacks?
The Bluetooth icon is not showing but the audio is routing via Bluetooth.
BT- Bluetooth
To Reproduce Steps to reproduce the behavior:
Expected behavior BT options should be there in the device list.
Actual behavior The voice is transmitted through Bluetooth, but Bluetooth does not appear in the device list, preventing us from displaying the Bluetooth option in the UI.
Application Logs Steps wise Step1 to 5
Step 6 : Disconnect BT
Step 6: Reconnect BT: Working fine
15:00:33.896 D Bluetooth SCO disconnected 15:00:34.077 D Bluetooth headset BluetoothDeviceWrapperImpl(device=XX:XX:XX:XX:54:B4, name=Jabra Elite 4, deviceClass=7936) connected 15:00:34.080 D Headset state changed to Connected 15:00:34.080 D Earpiece available 15:00:34.418 D Speakerphone available 15:00:34.419 D Available AudioDevice list updated: [BluetoothHeadset(name=Jabra Elite 4), Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)] 15:00:34.419 D Current user selected AudioDevice = null 15:00:34.426 D Scheduled bluetooth sco job 15:00:34.429 D Bluetooth SCO disconnected 15:00:34.432 D Attempting to enable bluetooth SCO 15:00:34.432 D Headset state changed to AudioActivating 15:00:34.482 D Bluetooth SCO connecting 15:00:34.580 D Bluetooth audio connected on device BluetoothDeviceWrapperImpl(device=XX:XX:XX:XX:54:B4, name=Jabra Elite 4, deviceClass=7936) 15:00:34.580 D Canceled bluetooth sco job 15:00:34.580 D Headset state changed to AudioActivated 15:00:34.580 D Earpiece available 15:00:34.598 D Speakerphone available 15:00:34.598 D Available AudioDevice list updated: [BluetoothHeadset(name=Jabra Elite 4), Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)] 15:00:34.598 D Current user selected AudioDevice = null 15:00:34.745 W Cannot activate when in the AudioActivated state 15:00:34.746 D Bluetooth SCO disconnected 15:00:35.624 D Bluetooth SCO connected Step 7: Disconnect the call
15:02:01.251 D AudioSwitch(1.2.0) 15:02:01.252 D Preferred device list = [BluetoothHeadset, WiredHeadset, Earpiece, Speakerphone] 15:02:01.289 D Redundant stop() invocation while already in the stopped state
Step 8: When receiving incoming calls and clicking the accept button, the audio comes through Bluetooth, but the Bluetooth option is not available in the UI:
Sometimes Logcat observation:
AudioSwitch Version
Android Device (please complete the following information):
Screenshots: Audio is coming via BT
My Observation and logs based on steps There are two options to disconnect the call: from the main UI and the notification drawer. The issue typically occurs when I disconnect the call via the notification drawer but the code is same in both cases.
Code snippet related audio switch:
VoiceCallService:
Audio Switch Initialization:
_audioSwitch = AudioSwitch(applicationContext, loggingEnabled = true)