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

Skip to content
Commit 92f52ac8 authored by Cheney Ni's avatar Cheney Ni Committed by Jack He
Browse files

Using std::promise and std::future to block till A2DP device activated

There is a new interface to replace UIPC with Blueototh Audio Hal v2 and
synchronization issues between BT Stack and Audio Hal was found when
activating a new A2DP device. Because the API to activate an A2DP device
was non-blocking, it was possilbe that there was a race condition when
BT Stack starting A2DP session and Audio Hal was opening A2DP output.
There was a chance that the output was opened before session started and
causing A2DP to have no sound.

This CL uses std::promise and std::future are able to achieve the
serialize of starting session and opening output for A2DP.

Bug: 111519504
Bug: 122505783
Test: A2DP reconnection and switching

Change-Id: I88c42ea1eb5f8def2345dbfaab26c6d1a91c54cc
parent 69d75b47
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