Skip to content
Commit 139f7c23 authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi
Browse files

Fix race condition in SoundTriggerHw2Enforcer

Since HIDL doesn't guarantee message ordering between sync calls into
the HAL and async calls coming from the HAL, we have a rare
possibility of a race condition if a detection event callback arrives
before the startRecognition call returns. This change addresses that.
We do so by holding the lock during the calls into the HAL. We do NOT
hold the lock during the the "upward" calls to avoid deadlocks.

Fixes: 177795410
Test: Manual verification of STHAL operation.
      Sent patch to bug reporter to apply and test.
Change-Id: Ie042a92afa998d6d78786942146e3c533c401cd5
parent cae6ddb1
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