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

Skip to content
Commit 5d837eac authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioTrack: fix race condition between start and restore

There is a small window in AudioTrack::start where it is possible that
a concurrent track invalidation yields to rejecting the start request and leave
the track paused when later restored.
To avoid this race, return DEAD_OBJECT from AudioPolicyManager::startOutput()
if the output is already closed.

This aligns the behavior with startInput().

Also apply the same behavior to stopOutput() and stopInput() for consistency.
Apply the same fix to AudioRecord.

Bug: 367917846
Test: make
Flag: EXEMPT bug fix
Change-Id: I1c2051a2d7e58042cde5166914c68a081cd4bb49
parent ca2abe33
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