Sensor: HAL guideline clarification upon activation request
Sensor events can be generated even after completion of sensor deactivation
request so the correct time to abandon the stale events is before making new
activation request instead after sensor deactivation request.
For example: In data injection mode which make sensor deactivation request,
sensor events are generated in sensor deactivation state. These events may
not have been picked up by poll before completion of switching to normal mode.
So it is necessary to abandon stale events at the time of activation request
so that in normal mode, application will not get injected events generated
during data injection mode.
Test: Inject sensor events at fastest possible sensor rate in data injection
mode and check whether there is any injected event received by application
after switching to normal mode.
Signed-off-by: Aniroop Mathur <firstname.lastname@example.org>
1 file changed