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

Commit 380b8ba3 authored by Peng Xu's avatar Peng Xu
Browse files

Correct sensor handle for operation parameter

Sensor handle 0 is a valid sensor handle. Use SENSORS_HANDLE_BASE - 1
instead in inject_sensor_data for operation parameter.

Test: sensor cts passes
Bug: 37956047
Change-Id: I138c2e21d74f532526a53a76be857866764a3d53
parent 2041913a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1070,7 +1070,7 @@ int SensorService::setOperationParameter(
    for (sensors_event_t* i = event; i < event + 3; i++) {
        *i = (sensors_event_t) {
            .version = sizeof(sensors_event_t),
            .sensor = 0,
            .sensor = SENSORS_HANDLE_BASE - 1, // sensor that never exists
            .type = SENSOR_TYPE_ADDITIONAL_INFO,
            .timestamp = timestamp++,
            .additional_info = (additional_info_event_t) {