[soundtrigger] Fix releaseAudioSession deadlock
Calling into releaseAudioSession holding the STM lock is dangerous, as the STM lock is waited for by STHAL callbacks (including abort). This callback fires from the HAL while servicing startRecord calls, which holds APM/AF locks. releaseAudioSession waits for the APM lock, causing a cross deadlock. Although the STHAL callback model in general is prone to these deadlocks due to upcalls, spot-fix this by pulling the releaseAudioSession call outside of the ST locks. This is fine, since there are no post-conditions on this call: it is essentially cleanup/gc (all the ids involved are monotonically increasing). Test: manual hotword Test: manual now playing Flag: EXEMPT bugfix Bug: 391620601 Change-Id: I67b8b2ee484be7c7aefb26d9df64689e5e3f5d00
Loading
Please register or sign in to comment