floss: Fix AvrcpDeviceConnected race
We wait for a period of time for both A2DP and HFP's capability to be updated before sending the device added event. If AvrcpDeviceConnected is triggered while we are waiting, we'll trigger the absolute volume support change event to audio stack. However, audio stack will regard it as an abnormal event as there is no device connected yet from its point of view. The pending device added event triggered after the volume support event won't help as the absolute_volume value in the device added event is out-of-sync and wrong. Fix the race by canceling the pending added device event and add a new one with the correct absolute_volume information to solve the race and just don't trigger the absolute volume support change event when the device is not added. Bug: 243083916 Tag: #floss Test: Build and verify volume control works BYPASS_LONG_LINES_REASON: Bluetooth likes 120 char lines Change-Id: Ib76651a77fc3116c2d5b90dbabffe98dfb27424e
Loading
Please register or sign in to comment