Use communication device callback and fix reinitialization routing
This CL replaces the speaker broadcasts with using the provided AudioManager onCommunicationDeviceChanged callback in order to listen to updates to the communication device. This is done with the hope of seeing improved performance with when Telecom receives indication of when the speaker toggles on/off. We have seen cases where when the speaker is toggled on/off quickly, the broadcasts can be received out of order and cause Telecom to show the audio route as speaker when audio is routing to earpiece, for example. This occurs as a result of switching from earpiece -> speaker -> earpiece and Telecom receiving SPEAKER_ON after SPEAKER_OFF. There is also a fix done to ensure that the audio routing is reinitialized at the end of the call. We've gotten reports from user that if the audio is routed to speaker and another call is placed, then there is an audio flicker from speaker to earpiece in the UI at the beginning of the call. Bug: 353419513 Bug: 371625143 Flag: com.android.server.telecom.flags.new_audio_path_speaker_broadcast_and_unfocused_routing Test: Added unit test for verifying call audio route reintialization Test: Manual to confirm that onCommunicationDeviceChanged callback is being received for speaker phone switches. Tested with switching between earpiece, speaker, and LEHS. Change-Id: If51cc560791cbc81734a2ff6e3e57067910531cb
Loading
Please register or sign in to comment