Enable wakeup sensors.
SensorService should hold a wakelock till the app reads events from a wakeup sensor. Currently drivers hold a wakelock with a
timeout while delivering events from a wake up sensor like Significant Motion. This hack can be removed now.
Bug: 9774884
Change-Id: If3b5acb99c9cf0cd29012fcfa9d6b04c74133d01
diff --git a/include/gui/SensorEventQueue.h b/include/gui/SensorEventQueue.h
index 0bfc7a0..4e8a2d2 100644
--- a/include/gui/SensorEventQueue.h
+++ b/include/gui/SensorEventQueue.h
@@ -27,7 +27,7 @@
#include <gui/BitTube.h>
// ----------------------------------------------------------------------------
-
+#define WAKE_UP_SENSOR_EVENT_NEEDS_ACK (1 << 31)
struct ALooper;
struct ASensorEvent;
@@ -75,7 +75,8 @@
int reservedFlags) const;
status_t disableSensor(int32_t handle) const;
status_t flush() const;
-
+ // Send an ack for every wake_up sensor event that is set to WAKE_UP_SENSOR_EVENT_NEEDS_ACK.
+ void sendAck(const ASensorEvent* events, int count);
private:
sp<Looper> getLooper() const;
sp<ISensorEventConnection> mSensorEventConnection;