diff options
Diffstat (limited to 'include/gui')
-rw-r--r-- | include/gui/ISensorEventConnection.h | 1 | ||||
-rw-r--r-- | include/gui/Sensor.h | 3 | ||||
-rw-r--r-- | include/gui/SensorEventQueue.h | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/include/gui/ISensorEventConnection.h b/include/gui/ISensorEventConnection.h index f64c6b8..b296797 100644 --- a/include/gui/ISensorEventConnection.h +++ b/include/gui/ISensorEventConnection.h @@ -40,6 +40,7 @@ public: nsecs_t maxBatchReportLatencyNs, int reservedFlags) = 0; virtual status_t setEventRate(int handle, nsecs_t ns) = 0; virtual status_t flush() = 0; + virtual void decreaseWakeLockRefCount() = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h index 033b262..41a6cc6 100644 --- a/include/gui/Sensor.h +++ b/include/gui/Sensor.h @@ -71,6 +71,7 @@ public: int32_t getFifoMaxEventCount() const; const String8& getStringType() const; const String8& getRequiredPermission() const; + bool isWakeUpSensor() const; // LightFlattenable protocol inline bool isFixedSize() const { return false; } @@ -93,6 +94,8 @@ private: int32_t mFifoMaxEventCount; String8 mStringType; String8 mRequiredPermission; + // Todo: Surface this in java SDK. + bool mWakeUpSensor; static void flattenString8(void*& buffer, size_t& size, const String8& string8); static bool unflattenString8(void const*& buffer, size_t& size, String8& outputString8); }; 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 @@ public: 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; |