Fix the 'flush' function for emulated sensors

Flush operations could get lost by being overwritten
if a sensor value arrives before the 'flush' is seen.

This CL prevents overwriting the 'flush' if it hasn't
been accepted.

With this change, all 51 'SensorBatchingTests' pass.

Bug: 37465457

Test: CTS: CtsSensorTestCases android.hardware.cts.SensorBatchingTests

Change-Id: Iabf58ce0868f1470a8aa4b2c2b845dc30ca466cf
(cherry picked from commit 9ca9f56b11340307425ac09a497cde29af025cc6)
1 file changed