summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAravind Akella <aakella@google.com>2014-04-11 19:40:33 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-11 19:40:33 +0000
commit93b84e39e6cbb9f2ba37125465c4040e03b56048 (patch)
tree7e7d2e360b2debfd77452734d8df96a883ea8548 /include
parent21f18e693528bd255719801539f68e37b4a97418 (diff)
parentef89f7638c43ce5f73e32d487bf65c3375995e3b (diff)
downloadframeworks_native-93b84e39e6cbb9f2ba37125465c4040e03b56048.zip
frameworks_native-93b84e39e6cbb9f2ba37125465c4040e03b56048.tar.gz
frameworks_native-93b84e39e6cbb9f2ba37125465c4040e03b56048.tar.bz2
am ef89f763: am cf818ebb: Merge "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors" into klp-modular-dev
* commit 'ef89f7638c43ce5f73e32d487bf65c3375995e3b': Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
Diffstat (limited to 'include')
-rw-r--r--include/android/sensor.h22
-rw-r--r--include/gui/Sensor.h6
2 files changed, 28 insertions, 0 deletions
diff --git a/include/android/sensor.h b/include/android/sensor.h
index 129ea3e..b4e7ebe 100644
--- a/include/android/sensor.h
+++ b/include/android/sensor.h
@@ -281,6 +281,28 @@ float ASensor_getResolution(ASensor const* sensor);
*/
int ASensor_getMinDelay(ASensor const* sensor);
+/*
+ * Returns the maximum size of batches for this sensor. Batches will often be
+ * smaller, as the hardware fifo might be used for other sensors.
+ */
+int ASensor_getFifoMaxEventCount(ASensor const* sensor);
+
+/*
+ * Returns the hardware batch fifo size reserved to this sensor.
+ */
+int ASensor_getFifoReservedEventCount(ASensor const* sensor);
+
+/*
+ * Returns this sensor's string type.
+ */
+const char* ASensor_getStringType(ASensor const* sensor);
+
+/*
+ * Returns the permission required to see or access this sensor, or the
+ * empty string if none is required.
+ */
+const char* ASensor_getRequiredPermission(ASensor const* sensor);
+
#ifdef __cplusplus
};
diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h
index 0c81426..033b262 100644
--- a/include/gui/Sensor.h
+++ b/include/gui/Sensor.h
@@ -69,6 +69,8 @@ public:
int32_t getVersion() const;
int32_t getFifoReservedEventCount() const;
int32_t getFifoMaxEventCount() const;
+ const String8& getStringType() const;
+ const String8& getRequiredPermission() const;
// LightFlattenable protocol
inline bool isFixedSize() const { return false; }
@@ -89,6 +91,10 @@ private:
int32_t mVersion;
int32_t mFifoReservedEventCount;
int32_t mFifoMaxEventCount;
+ String8 mStringType;
+ String8 mRequiredPermission;
+ static void flattenString8(void*& buffer, size_t& size, const String8& string8);
+ static bool unflattenString8(void const*& buffer, size_t& size, String8& outputString8);
};
// ----------------------------------------------------------------------------