Merge "Deactivate sensors after flush events are received" into qt-dev

am: 8913d1df2c

Change-Id: Ie32a5d1c5f1308060af6ae8c3b7d4c25ebdc9301
This commit is contained in:
Anthony Stange
2019-07-02 15:14:45 -07:00
committed by android-build-merger

View File

@@ -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