diff options
author | Nick Vaccaro <nvaccaro@google.com> | 2014-06-19 13:27:39 -0700 |
---|---|---|
committer | Nick Vaccaro <nvaccaro@google.com> | 2014-06-19 13:29:33 -0700 |
commit | 58fe70cf169ef13506bd49e61e2cbd4dc1bf02e3 (patch) | |
tree | 927ac4c2e98090a20fc5aa5f8aca00761288fdb3 | |
parent | e677ba07721a9e16ca90bf6e95df52d92817d3f9 (diff) | |
download | invensense-58fe70cf169ef13506bd49e61e2cbd4dc1bf02e3.tar.gz |
Revert "Invensense: 6515: allow flush calls for step detector"
This reverts commit c994cff5873e223100a9f4f2ce9281bec460ef16.
This fixes step counter behavior, but breaks CTS tests for
testBatchAndFlush and testBatchAndFlushWithHandler (b/15316005).
Bug: 15695965
Change-Id: I9660c11c8811fdfc207d66137667b5a781ac41fe
-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); } |