summaryrefslogtreecommitdiffstats
path: root/sensors
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-07-02 16:28:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-07-02 16:28:53 +0000
commit8913d1df2c837312305760de60834d3179378a6d (patch)
tree5c62250089a7b068f9ef563e85526a01d4a17444 /sensors
parentd016fd79497b5af04a6434fb40ce29810c4e7c59 (diff)
parent4d904009857a6d62a3838bf167f8542f0495a714 (diff)
downloadandroid_hardware_interfaces-8913d1df2c837312305760de60834d3179378a6d.tar.gz
android_hardware_interfaces-8913d1df2c837312305760de60834d3179378a6d.tar.bz2
android_hardware_interfaces-8913d1df2c837312305760de60834d3179378a6d.zip
Merge "Deactivate sensors after flush events are received" into qt-dev
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 39053fe75..62c533444 100644
--- a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp
+++ b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp
@@ -683,11 +683,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