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

Skip to content
Commit 406619f4 authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi
Browse files

Avoid risk of deadlock between APM and sound trigger

Sound trigger calls into audio policy manager (APM) for the sake of
allocating and releasing audio sessions.
APM calls into sound trigger for the sake of notifying it of
external capture session start/end.

Both calls are essentially synchronous, i.e. required for the
completion of the operations that trigger them.
Since both services use coarse locks to protect their state, if both
those calls happen concurrently, a deadlock would result.

The fix is to invoke
AudioPolicyManager::{acquire/release}SoundTriggerSession()
outside of the critical section of SoundTriggerModule.

Bug: 148691451
Change-Id: I157367b9e43963e37344958e1647e9f6c29d5e6e
parent 54e0f0a3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment