diff options
| author | 2021-06-04 19:27:09 +0000 | |
|---|---|---|
| committer | 2021-06-08 20:08:53 +0000 | |
| commit | 1983a71e2a29934ec3a7c8a0fb20e0ced0ad44dc (patch) | |
| tree | b5187bcb2eef8d3ea32504dc9ed4c70ad19245dc /include/input/InputDevice.h | |
| parent | 9d7aee1d786b01942e90cb6972b2bc1e06920aef (diff) | |
Return a copy of InputDeviceLightInfo instead of pointer
Refactor InputReaderInterface to return a copy instead of pointer. This
will ensure that we don't read from memory that's been freed.
Also, refactor InputDevice api's to return a list of infos instead of
having to query each individually. In all usages so far, there's no need
to get a specific info by type.
Bug: 190126442
Test: atest inputflinger_tests libinput_tests
Change-Id: I7f993a14259bb802e2631663c1c8bb65cc9b6702
Diffstat (limited to 'include/input/InputDevice.h')
| -rw-r--r-- | include/input/InputDevice.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h index 1fec08027f..7f0324a4a8 100644 --- a/include/input/InputDevice.h +++ b/include/input/InputDevice.h @@ -257,13 +257,9 @@ public: return mMotionRanges; } - const InputDeviceSensorInfo* getSensorInfo(InputDeviceSensorType type); + std::vector<InputDeviceSensorInfo> getSensors(); - const std::vector<InputDeviceSensorType> getSensorTypes(); - - const std::vector<int32_t> getLightIds(); - - const InputDeviceLightInfo* getLightInfo(int32_t id); + std::vector<InputDeviceLightInfo> getLights(); private: int32_t mId; |