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

Commit cb59b052 authored by shrikar's avatar shrikar
Browse files

Added resolution check in DefaultVehicleHal

Bug: 276124296
Test: atest DefaultVehicleHalTest
Change-Id: If53c6395a8ea9656e6b59a43872a0d9f6871dac5
parent 67c465f7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -722,6 +722,10 @@ VhalResult<void> DefaultVehicleHal::checkSubscribeOptions(
                return StatusError(StatusCode::INVALID_ARG)
                       << "invalid sample rate: " << sampleRateHz << " HZ";
            }
            if (!SubscriptionManager::checkResolution(option.resolution)) {
                return StatusError(StatusCode::INVALID_ARG)
                       << "invalid resolution: " << option.resolution;
            }
        }
    }
    return {};
+8 −0
Original line number Diff line number Diff line
@@ -233,6 +233,14 @@ std::vector<SubscribeInvalidOptionsTestCase> getSubscribeInvalidOptionsTestCases
                                    .sampleRate = 0.0,
                            },
            },
            {
                    .name = "invalid_resolution",
                    .option =
                            {
                                    .propId = GLOBAL_CONTINUOUS_PROP,
                                    .resolution = 2.0,
                            },
            },
            {
                    .name = "static_property",
                    .option =