summaryrefslogtreecommitdiff
path: root/6515
diff options
context:
space:
mode:
authorNick Vaccaro <nvaccaro@google.com>2014-06-19 21:18:46 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-19 21:18:46 +0000
commit98fdf2b4814602099a16b973f8bda9e5579c8672 (patch)
tree1e574a5b95a31ef9a0586497aaa6fd646e453cba /6515
parent6a068434df770cb7bc4e626586d4f780180ee873 (diff)
parentab67f29c5f31ad0c90a2f2fed70afe71ca9e5464 (diff)
downloadinvensense-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.cpp6
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);
}