diff options
author | Nick Vaccaro <nvaccaro@google.com> | 2014-06-19 21:18:46 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-19 21:18:46 +0000 |
commit | 98fdf2b4814602099a16b973f8bda9e5579c8672 (patch) | |
tree | 1e574a5b95a31ef9a0586497aaa6fd646e453cba /6515 | |
parent | 6a068434df770cb7bc4e626586d4f780180ee873 (diff) | |
parent | ab67f29c5f31ad0c90a2f2fed70afe71ca9e5464 (diff) | |
download | invensense-98fdf2b4814602099a16b973f8bda9e5579c8672.tar.gz |
am ab67f29c: am 58fe70cf: Revert "Invensense: 6515: allow flush calls for step detector"
* commit 'ab67f29c5f31ad0c90a2f2fed70afe71ca9e5464':
Revert "Invensense: 6515: allow flush calls for step detector"
Diffstat (limited to '6515')
-rw-r--r-- | 6515/libsensors_iio/MPLSensor.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/6515/libsensors_iio/MPLSensor.cpp b/6515/libsensors_iio/MPLSensor.cpp index b6d762a..c63d8b4 100644 --- a/6515/libsensors_iio/MPLSensor.cpp +++ b/6515/libsensors_iio/MPLSensor.cpp @@ -5838,6 +5838,12 @@ int MPLSensor::flush(int handle) LOGV_IF(PROCESS_VERBOSE, "HAL: flush - select sensor %s (handle %d)", sname.string(), handle); + if (((what != StepDetector) && (!(mEnabled & (1 << what)))) || + ((what == StepDetector) && !(mFeatureActiveMask & INV_DMP_PEDOMETER))) { + LOGE_IF(ENG_VERBOSE, "HAL: flush - sensor %s not enabled", sname.string()); + return -EINVAL; + } + if(!(mBatchEnabled & (1 << what))) { LOGV_IF(PROCESS_VERBOSE, "HAL:flush - batch mode not enabled for sensor %s (handle %d)", sname.string(), handle); } |