diff options
author | Mathias Agopian <mathias@google.com> | 2010-07-21 15:59:50 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-07-21 16:09:39 -0700 |
commit | 23e8de26b7b3d04daf08526f314c2fdd2f8fee65 (patch) | |
tree | 239037f931ad847efc861c12c94b68c855a894d6 /libs | |
parent | 5df13ef30e7dd58e4e718e6d949ac3d1f5af94e0 (diff) | |
download | frameworks_base-23e8de26b7b3d04daf08526f314c2fdd2f8fee65.zip frameworks_base-23e8de26b7b3d04daf08526f314c2fdd2f8fee65.tar.gz frameworks_base-23e8de26b7b3d04daf08526f314c2fdd2f8fee65.tar.bz2 |
propagate sensor event rate properly
Change-Id: I32e67d30e4295285a6827956cc8161b2025d70bc
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gui/SensorEventQueue.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp index cc98656..4b46842 100644 --- a/libs/gui/SensorEventQueue.cpp +++ b/libs/gui/SensorEventQueue.cpp @@ -114,8 +114,12 @@ status_t SensorEventQueue::disableSensor(Sensor const* sensor) const { return mSensorEventConnection->enableDisable(sensor->getHandle(), false); } -status_t SensorEventQueue::enableSensor(int32_t handle) const { - return mSensorEventConnection->enableDisable(handle, true); +status_t SensorEventQueue::enableSensor(int32_t handle, int32_t ms) const { + status_t err = mSensorEventConnection->enableDisable(handle, true); + if (err == NO_ERROR) { + mSensorEventConnection->setEventRate(handle, ms2ns(ms)); + } + return err; } status_t SensorEventQueue::disableSensor(int32_t handle) const { |