Simulate handling of event when throttling
When trottling we need to simulate handling of the event as otherwise the DSP gets upset and SoundTriggerService and SoundTriggerHelper get out of sync. (1) Currently the DSP requires to open and release the AudioRecord if a event was detected. Hence If we drop and event we need to do the minimal version of that (2) If a recognitions is set up with !allowMultipleTriggers the other parts assume that as soon as one even is handled no further will be needed. The other parts of the system are not aware of throttling. Hence even when throttled we have to destroy the service when !allowMultipleTriggers. We do this by splitting the ops into three parts. Setup (always executed): Takes care of problem (2) by checking the flag and setting the destroy-once-ops-and-handled flag Execute (not thottled): Send the op to the remote service Drop (Trottled): Do what is needed if the remote service is not involved. This handled issue (1) Test: Caused throttling and saw - AudioRecord started and released - service connection destroyed Bug: 78212455 Change-Id: I0ff81a7b38d07db1365be7ecc44e93cf329b32d5
Loading
Please register or sign in to comment