summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/android/sensor.h15
-rw-r--r--include/gui/Sensor.h4
2 files changed, 18 insertions, 1 deletions
diff --git a/include/android/sensor.h b/include/android/sensor.h
index 878f8ff..77a5a1c 100644
--- a/include/android/sensor.h
+++ b/include/android/sensor.h
@@ -74,6 +74,16 @@ enum {
};
/*
+ * Sensor Reporting Modes.
+ */
+enum {
+ AREPORTING_MODE_CONTINUOUS = 0,
+ AREPORTING_MODE_ON_CHANGE = 1,
+ AREPORTING_MODE_ONE_SHOT = 2,
+ AREPORTING_MODE_SPECIAL_TRIGGER = 3
+};
+
+/*
* A few useful constants
*/
@@ -306,6 +316,11 @@ int ASensor_getFifoReservedEventCount(ASensor const* sensor);
*/
const char* ASensor_getStringType(ASensor const* sensor);
+/*
+ * Returns the reporting mode for this sensor. One of AREPORTING_MODE_* constants.
+ */
+int ASensor_getReportingMode(ASensor const* sensor);
+
#ifdef __cplusplus
};
#endif
diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h
index c1c98b9..28a08e2 100644
--- a/include/gui/Sensor.h
+++ b/include/gui/Sensor.h
@@ -72,7 +72,9 @@ public:
const String8& getStringType() const;
const String8& getRequiredPermission() const;
int32_t getMaxDelay() const;
+ int32_t getFlags() const;
bool isWakeUpSensor() const;
+ int32_t getReportingMode() const;
// LightFlattenable protocol
inline bool isFixedSize() const { return false; }
@@ -96,7 +98,7 @@ private:
String8 mStringType;
String8 mRequiredPermission;
int32_t mMaxDelay;
- bool mWakeUpSensor;
+ int32_t mFlags;
static void flattenString8(void*& buffer, size_t& size, const String8& string8);
static bool unflattenString8(void const*& buffer, size_t& size, String8& outputString8);
};