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

Skip to content
Commit ae5fb990 authored by Chris Thornton's avatar Chris Thornton
Browse files

Fix deadlock in SoundTriggerService using intent API.

The callback of the SoundTriggerService using the intent API used to try
and grab the same lock that other calls to the STS were using when they
accessed the SoundTriggerHelper.

This happens because most functions in the STH grab the STH's lock,
including the one that handles the recognition events. The recognition
event callback in the STS would then try to grab the STS lock, while
implicitly holding the STH one.

However, a concurrent call to the STS from outside could first grab the
STS lock, then call into the STH which may need the STH lock, resulting
in a deadlock.

By removing the requirement that the STS callback grab the main STS
lock, this condition is avoided.

Bug: 70346433
Test: On device
Change-Id: I44571fba786a82a17423d45f503be9537b476a01
parent 153daa89
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