diff options
author | Mathias Agopian <mathias@google.com> | 2010-07-29 22:06:44 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-07-29 22:06:44 -0700 |
commit | ce49d03aa40123a086d6017052873bed83835298 (patch) | |
tree | 2de1d2e8a3e34939c75b9b01418fe6c09b4cfca9 /native | |
parent | d4e60a1f8e6a92102c0ac55775c4153e31aec407 (diff) | |
parent | 02513855530b80dd554b13852db75f3adde2c9f4 (diff) | |
download | frameworks_base-ce49d03aa40123a086d6017052873bed83835298.zip frameworks_base-ce49d03aa40123a086d6017052873bed83835298.tar.gz frameworks_base-ce49d03aa40123a086d6017052873bed83835298.tar.bz2 |
resolved conflicts for merge of 02513855 to master
Change-Id: Ie33d57798d3d5b800edde753dac86de062bc270c
Diffstat (limited to 'native')
-rw-r--r-- | native/android/sensor.cpp | 4 | ||||
-rw-r--r-- | native/include/android/sensor.h | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/native/android/sensor.cpp b/native/android/sensor.cpp index e1fc4e7..db534e0 100644 --- a/native/android/sensor.cpp +++ b/native/android/sensor.cpp @@ -149,3 +149,7 @@ float ASensor_getResolution(ASensor const* sensor) return static_cast<Sensor const*>(sensor)->getResolution(); } +int ASensor_getMinDelay(ASensor const* sensor) +{ + return static_cast<Sensor const*>(sensor)->getMinDelay(); +} diff --git a/native/include/android/sensor.h b/native/include/android/sensor.h index 00d95d8..b4ce024 100644 --- a/native/include/android/sensor.h +++ b/native/include/android/sensor.h @@ -121,6 +121,7 @@ typedef struct ASensorEvent { float temperature; float distance; float light; + float pressure; }; int32_t reserved1[4]; } ASensorEvent; @@ -188,7 +189,8 @@ int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sen /* * Sets the delivery rate of events in microseconds for the given sensor. * Note that this is a hint only, generally event will arrive at a higher - * rate. + * rate. It is an error to set a rate inferior to the value returned by + * ASensor_getMinDelay(). * Returns a negative error code on failure. */ int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, int32_t usec); @@ -239,6 +241,13 @@ int ASensor_getType(ASensor const* sensor); */ float ASensor_getResolution(ASensor const* sensor); +/* + * Returns the minimum delay allowed between events in microseconds. + * A value of zero means that this sensor doesn't report events at a + * constant rate, but rather only when a new data is available. + */ +int ASensor_getMinDelay(ASensor const* sensor); + #ifdef __cplusplus }; |