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
Loading
Please register or sign in to comment