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