summaryrefslogtreecommitdiffstats
path: root/sensors
diff options
context:
space:
mode:
authorAnthony Stange <stange@google.com>2019-07-02 15:14:45 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-07-02 15:14:45 -0700
commit80a247e090c95ba1ba8870c2dc8400aac9736e6f (patch)
treec3a77f4b48677fe59e8d804ee96b692c374b9ca2 /sensors
parenta8baf71318f045b4157f1ef0cf16c4c6e66ebe7b (diff)
parent8913d1df2c837312305760de60834d3179378a6d (diff)
downloadandroid_hardware_interfaces-80a247e090c95ba1ba8870c2dc8400aac9736e6f.tar.gz
android_hardware_interfaces-80a247e090c95ba1ba8870c2dc8400aac9736e6f.tar.bz2
android_hardware_interfaces-80a247e090c95ba1ba8870c2dc8400aac9736e6f.zip
Merge "Deactivate sensors after flush events are received" into qt-dev
am: 8913d1df2c Change-Id: Ie32a5d1c5f1308060af6ae8c3b7d4c25ebdc9301
Diffstat (limited to 'sensors')
-rw-r--r--sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp
index c6d7cada2..91b4fa559 100644
--- a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp
+++ b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp
@@ -696,11 +696,16 @@ void SensorsHidlTest::runFlushTest(const std::vector<SensorInfo>& sensors, bool
Result flushResult = flush(sensor.sensorHandle);
ASSERT_EQ(flushResult, expectedResponse);
}
- activate(sensor.sensorHandle, false);
}
// Wait up to one second for the flush events
callback.waitForFlushEvents(sensors, flushCalls, 1000 /* timeoutMs */);
+
+ // Deactivate all sensors after waiting for flush events so pending flush events are not
+ // abandoned by the HAL.
+ for (const SensorInfo& sensor : sensors) {
+ activate(sensor.sensorHandle, false);
+ }
getEnvironment()->unregisterCallback();
// Check that the correct number of flushes are present for each sensor