Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 91868c52 authored by En-Shuo Hsu's avatar En-Shuo Hsu
Browse files

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
parent c2d8341a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment