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

Commit e5a38eb5 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

libaudiohal: Make closing of HAL stream an explicit call for AudioFlinger

Since introduction to Treble, closing of the HAL stream has been moved into
`StreamHal*` class destructors. Due to reference counting management of
instances of these classes this approach creates non-determinism about the
moment when the HAL stream is actually get closed. This is undesired
because some resources related to HAL streams are unique, and the audio
framework must be in a full control of the timing of their release.

Added `StreamHalInterface::close` for explicit release of HAL stream
resources. On the AudioFlinger side, this method is now called from the
destructor of `AudioStreamIn|Out` classes since they are the control the
lifetime of the HAL stream from the AudioFlinger POV.

Flag: EXEMPT bugfix
Bug: 425272644
Test: atest CtsMediaAudioTestCases CoreAudioHalAidlTest
Test: atest audiorecord_tests trackplayerbase_tests
Change-Id: I1c1e3517e7f3b2ffee0a0e8f00a9ab9f538875fd
parent 5e7e00ae
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