mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
Merge "VTS Sensor HAL 2.0: Fix Batch for One Shot sensors" into qt-r1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
effdb89c97
@@ -790,7 +790,12 @@ TEST_F(SensorsHidlTest, Batch) {
|
||||
activateAllSensors(false /* enable */);
|
||||
for (const SensorInfo& sensor : getSensorsList()) {
|
||||
// Call batch on inactive sensor
|
||||
ASSERT_EQ(batch(sensor.sensorHandle, sensor.minDelay, 0 /* maxReportLatencyNs */),
|
||||
// One shot sensors have minDelay set to -1 which is an invalid
|
||||
// parameter. Use 0 instead to avoid errors.
|
||||
int64_t samplingPeriodNs = extractReportMode(sensor.flags) == SensorFlagBits::ONE_SHOT_MODE
|
||||
? 0
|
||||
: sensor.minDelay;
|
||||
ASSERT_EQ(batch(sensor.sensorHandle, samplingPeriodNs, 0 /* maxReportLatencyNs */),
|
||||
Result::OK);
|
||||
|
||||
// Activate the sensor
|
||||
|
||||
Reference in New Issue
Block a user