diff options
author | Aravind Akella <aakella@google.com> | 2013-09-03 17:45:18 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-03 17:45:18 -0700 |
commit | 91e0ff57394466e822c4c388030e7cb5052002a5 (patch) | |
tree | 32498b15f57ac4db5348bc6330f992a3494132e4 /include | |
parent | 68ca2640a76a46c1719588c78460f1d79f9d74fb (diff) | |
parent | e29df8b929128621c8ef90091696d414eb235276 (diff) | |
download | frameworks_native-91e0ff57394466e822c4c388030e7cb5052002a5.zip frameworks_native-91e0ff57394466e822c4c388030e7cb5052002a5.tar.gz frameworks_native-91e0ff57394466e822c4c388030e7cb5052002a5.tar.bz2 |
am e29df8b9: am a5552de9: Merge "Sensor batching. Changes to the native code." into klp-dev
* commit 'e29df8b929128621c8ef90091696d414eb235276':
Sensor batching. Changes to the native code.
Diffstat (limited to 'include')
-rw-r--r-- | include/android/sensor.h | 29 | ||||
-rw-r--r-- | include/gui/ISensorEventConnection.h | 4 | ||||
-rw-r--r-- | include/gui/Sensor.h | 6 | ||||
-rw-r--r-- | include/gui/SensorEventQueue.h | 4 |
4 files changed, 39 insertions, 4 deletions
diff --git a/include/android/sensor.h b/include/android/sensor.h index 32c5c0a..129ea3e 100644 --- a/include/android/sensor.h +++ b/include/android/sensor.h @@ -106,6 +106,30 @@ typedef struct ASensorVector { uint8_t reserved[3]; } ASensorVector; +typedef struct AMetaDataEvent { + int32_t what; + int32_t sensor; +} AMetaDataEvent; + +typedef struct AUncalibratedEvent { + union { + float uncalib[3]; + struct { + float x_uncalib; + float y_uncalib; + float z_uncalib; + }; + }; + union { + float bias[3]; + struct { + float x_bias; + float y_bias; + float z_bias; + }; + }; +} AUncalibratedEvent; + /* NOTE: Must match hardware/sensors.h */ typedef struct ASensorEvent { int32_t version; /* sizeof(struct ASensorEvent) */ @@ -123,6 +147,10 @@ typedef struct ASensorEvent { float distance; float light; float pressure; + float relative_humidity; + AUncalibratedEvent uncalibrated_gyro; + AUncalibratedEvent uncalibrated_magnetic; + AMetaDataEvent meta_data; }; union { uint64_t data[8]; @@ -132,7 +160,6 @@ typedef struct ASensorEvent { int32_t reserved1[4]; } ASensorEvent; - struct ASensorManager; typedef struct ASensorManager ASensorManager; diff --git a/include/gui/ISensorEventConnection.h b/include/gui/ISensorEventConnection.h index 749065e..00eecc4 100644 --- a/include/gui/ISensorEventConnection.h +++ b/include/gui/ISensorEventConnection.h @@ -36,8 +36,10 @@ public: DECLARE_META_INTERFACE(SensorEventConnection); virtual sp<BitTube> getSensorChannel() const = 0; - virtual status_t enableDisable(int handle, bool enabled) = 0; + virtual status_t enableDisable(int handle, bool enabled, nsecs_t samplingPeriodNs, + nsecs_t maxBatchReportLatencyNs, int reservedFlags) = 0; virtual status_t setEventRate(int handle, nsecs_t ns) = 0; + virtual status_t flushSensor(int handle) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h index 9197372..0c81426 100644 --- a/include/gui/Sensor.h +++ b/include/gui/Sensor.h @@ -53,7 +53,7 @@ public: }; Sensor(); - Sensor(struct sensor_t const* hwSensor); + Sensor(struct sensor_t const* hwSensor, int halVersion = 0); ~Sensor(); const String8& getName() const; @@ -67,6 +67,8 @@ public: int32_t getMinDelay() const; nsecs_t getMinDelayNs() const; int32_t getVersion() const; + int32_t getFifoReservedEventCount() const; + int32_t getFifoMaxEventCount() const; // LightFlattenable protocol inline bool isFixedSize() const { return false; } @@ -85,6 +87,8 @@ private: float mPower; int32_t mMinDelay; int32_t mVersion; + int32_t mFifoReservedEventCount; + int32_t mFifoMaxEventCount; }; // ---------------------------------------------------------------------------- diff --git a/include/gui/SensorEventQueue.h b/include/gui/SensorEventQueue.h index 759b5cb..8d8493b 100644 --- a/include/gui/SensorEventQueue.h +++ b/include/gui/SensorEventQueue.h @@ -68,8 +68,10 @@ public: status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; // these are here only to support SensorManager.java - status_t enableSensor(int32_t handle, int32_t us) const; + status_t enableSensor(int32_t handle, int32_t samplingPeriodUs, int maxBatchReportLatencyUs, + int reservedFlags) const; status_t disableSensor(int32_t handle) const; + status_t flushSensor(int32_t handle) const; private: sp<Looper> getLooper() const; |