Surface reportingMode for Sensors.
Change-Id: Iac8dd3408c90eb7d285a2e8043131fab3a7e58fa
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 @@
};
/*
+ * 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 @@
*/
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 @@
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 @@
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);
};