Skip to content
Commit 9efec811 authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi Committed by Eric Laurent
Browse files

Better fix for race condition in SoundTriggerHw2Enforcer

This reverts commit 139f7c23.

That commit had a potential for a deadlock, since calls both to and
from the HAL are synchronized and because of the requirement that
events are not permitted after stop() has been called, the HAL implementation
must block stop() for any outstanding events, but those events might
be blocked during the callback.

This fix avoids the original issue addressed by that commit in a
different manner: it simply reversed the ordering of setting the model
state and invoking start(), so that if an event arrives before start()
returns, we would still consider it valid.

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