From aaeeaa41bde52220fc63dab266b9ae9e2287595f Mon Sep 17 00:00:00 2001 From: Peng Xu Date: Wed, 5 Oct 2016 14:56:54 -0700 Subject: [PATCH] [sensor] Clarification of sensor HAL behavior at deactivation Sensor HAL should abandon stale data at deactivation. Test: documentation change, spell checked. Bug: 28443809 Change-Id: I29b1d324fc96d0448cdefbf2130161f71c3d3310 --- include/hardware/sensors.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h index 1d73c31c..b1df3172 100644 --- a/include/hardware/sensors.h +++ b/include/hardware/sensors.h @@ -1308,11 +1308,16 @@ typedef struct sensors_poll_device_1 { struct { struct hw_device_t common; - /* Activate/de-activate one sensor. Return 0 on success, negative + /* Activate/de-activate one sensor. * * sensor_handle is the handle of the sensor to change. * enabled set to 1 to enable, or 0 to disable the sensor. * + * After sensor de-activation, existing sensor events that have not + * been picked up by poll() should be abandoned immediately so that + * subsequent activation will not get stale sensor events (events + * that is generated prior to the latter activation). + * * Return 0 on success, negative errno code otherwise. */ int (*activate)(struct sensors_poll_device_t *dev,