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