Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb94a725 authored by Vishal Agarwal's avatar Vishal Agarwal Committed by android-build-merger
Browse files

Merge "VTS Sensor HAL 2.0: Fix Batch for One Shot sensors" into qt-r1-dev am:...

Merge "VTS Sensor HAL 2.0: Fix Batch for One Shot sensors" into qt-r1-dev am: effdb89c am: 7af073c7
am: 2fe3c426

Change-Id: I907a418ab70bca9500677e65ab9fdfc80d9a5599
parents 2052d858 2fe3c426
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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