Added SensorManager.getMinDelay()

Exposed the new "min delay" sensor property through native and
java sensor apis. This allows the caller to know what is the
maximum rate at which a sensor can return events, or, if a sensor
works in "update" mode (events returned only when the value changes).

Also augmented SensorManager.regusterSensorEvent() so that it can
accept a value in microsecond in addition to the 4 constants already
defined.

Change-Id: If425e9979892666df8c989d7de3c362230fa19e0
This commit is contained in:
Mathias Agopian
2010-07-29 16:51:38 -07:00
parent 3fb627525e
commit 050b56244f
10 changed files with 61 additions and 11 deletions

View File

@@ -114,10 +114,10 @@ status_t SensorEventQueue::disableSensor(Sensor const* sensor) const {
return mSensorEventConnection->enableDisable(sensor->getHandle(), false);
}
status_t SensorEventQueue::enableSensor(int32_t handle, int32_t ms) const {
status_t SensorEventQueue::enableSensor(int32_t handle, int32_t us) const {
status_t err = mSensorEventConnection->enableDisable(handle, true);
if (err == NO_ERROR) {
mSensorEventConnection->setEventRate(handle, ms2ns(ms));
mSensorEventConnection->setEventRate(handle, us2ns(us));
}
return err;
}