Resolve separate binding for BT ICS.
Improve the work that was done as part of the call audio refactoring work to separately bind to the BT ICS. This involves ensuring that the BT ICS is bound to prior to the Dialer ICS, namely, for handling MT calls. This will allow the BT call audio to properly handle ringing as well as the disconnect tone for SCO. This CL also modifies the new call audio routing logic to ensure that the call audio route is properly updated to bluetooth when the SCO audio is connected. It is possible that the headset state isn't updated when Telecom tries to connect to the SCO device, resulting in Telecom receiving an indication that the connection failed. Once the headset state is updated, the SCO audio will be connected and the audio will be routed to the device. Telecom should ensure that the UI is properly routed to reflect this. This does open up other possible race conditions like if an app requests audio to be routed to BT and Telecom requests SPEAKER_ON shortly after; if the SPEAKER_ON message is processed first, then the audio will be routed to BT instead if BT_AUDIO_CONNECTED is received after. This issue is difficult to resolve since if we ignore the BT_AUDIO_CONNECTED message when we don't expect a pending route switch, it opens ourselves to the aforementioned issue of the UI not reflecting that the audio has been routed to BT, which I think is a more prominent issue. This would probably require further discussion and possibly help from the BT team to help provide relevant information to the receiver which Telecom could use to decide when to ignore the connection state change. Bug: 328287261 Test: atest TelecomUnitTests Test: atest CtsTelecomTestCases Test: Manual to ensure disconnect tone is heard via HFP headset and verified logs to make sure that BT ICS is bound before Dialer ICS. Test: Manual toggling BT on/off in personal/work profile to ensure BT ICS is bound. Change-Id: I676159ad85edb962b2c7a1c782c8edd065e9c144
Loading
Please register or sign in to comment