diff options
author | Peng Xu <pengxu@google.com> | 2017-05-01 15:02:48 -0700 |
---|---|---|
committer | Peng Xu <pengxu@google.com> | 2017-05-03 22:20:33 +0000 |
commit | 9b0516fb972808085ff5cd037ed0e933a215c337 (patch) | |
tree | 5f0b1f4107c578e111114c23dbd64f1150eea0f6 | |
parent | a784a5a49e4f2bff2486cc71f6c32fc3507a7d98 (diff) | |
download | contexthub-9b0516fb972808085ff5cd037ed0e933a215c337.tar.gz |
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: If0ac77c70f1bf4175b17eab1a8394788e10852f5
-rw-r--r-- | sensorhal/sensors.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sensorhal/sensors.cpp b/sensorhal/sensors.cpp index 35d4555d..50610b55 100644 --- a/sensorhal/sensors.cpp +++ b/sensorhal/sensors.cpp @@ -230,7 +230,7 @@ int SensorContext::inject_sensor_data(const sensors_event_t *event) { return -EINVAL; } - if (event->sensor != 0) { + if (event->sensor != SENSORS_HANDLE_BASE - 1) { return -ENOSYS; } |