Loading services/inputflinger/include/InputReaderBase.h +3 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include "PointerControllerInterface.h" #include "VibrationElement.h" #include "include/gestures.h" // Maximum supported size of a vibration pattern. // Must be at least 2. Loading Loading @@ -367,6 +368,8 @@ public: virtual std::vector<InputDeviceSensorInfo> getSensors(int32_t deviceId) = 0; virtual std::optional<HardwareProperties> getTouchpadHardwareProperties(int32_t deviceId) = 0; /* Return true if the device can send input events to the specified display. */ virtual bool canDispatchToDisplay(int32_t deviceId, ui::LogicalDisplayId displayId) = 0; Loading services/inputflinger/reader/InputDevice.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -725,6 +725,15 @@ size_t InputDevice::getMapperCount() { return count; } std::optional<HardwareProperties> InputDevice::getTouchpadHardwareProperties() { std::optional<HardwareProperties> result = first_in_mappers<HardwareProperties>( [](InputMapper& mapper) -> std::optional<HardwareProperties> { return mapper.getTouchpadHardwareProperties(); }); return result; } void InputDevice::updateLedState(bool reset) { for_each_mapper([reset](InputMapper& mapper) { mapper.updateLedState(reset); }); } Loading services/inputflinger/reader/InputReader.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include <utils/Thread.h> #include "InputDevice.h" #include "include/gestures.h" using android::base::StringPrintf; Loading Loading @@ -817,6 +818,18 @@ std::vector<InputDeviceSensorInfo> InputReader::getSensors(int32_t deviceId) { return device->getDeviceInfo().getSensors(); } std::optional<HardwareProperties> InputReader::getTouchpadHardwareProperties(int32_t deviceId) { std::scoped_lock _l(mLock); InputDevice* device = findInputDeviceLocked(deviceId); if (device == nullptr) { return {}; } return device->getTouchpadHardwareProperties(); } bool InputReader::setLightColor(int32_t deviceId, int32_t lightId, int32_t color) { std::scoped_lock _l(mLock); Loading services/inputflinger/reader/include/InputDevice.h +2 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,8 @@ public: size_t getMapperCount(); std::optional<HardwareProperties> getTouchpadHardwareProperties(); // construct and add a mapper to the input device template <class T, typename... Args> T& addMapper(int32_t eventHubId, Args... args) { Loading services/inputflinger/reader/include/InputReader.h +2 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,8 @@ public: std::vector<InputDeviceSensorInfo> getSensors(int32_t deviceId) override; std::optional<HardwareProperties> getTouchpadHardwareProperties(int32_t deviceId) override; bool setLightColor(int32_t deviceId, int32_t lightId, int32_t color) override; bool setLightPlayerId(int32_t deviceId, int32_t lightId, int32_t playerId) override; Loading Loading
services/inputflinger/include/InputReaderBase.h +3 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include "PointerControllerInterface.h" #include "VibrationElement.h" #include "include/gestures.h" // Maximum supported size of a vibration pattern. // Must be at least 2. Loading Loading @@ -367,6 +368,8 @@ public: virtual std::vector<InputDeviceSensorInfo> getSensors(int32_t deviceId) = 0; virtual std::optional<HardwareProperties> getTouchpadHardwareProperties(int32_t deviceId) = 0; /* Return true if the device can send input events to the specified display. */ virtual bool canDispatchToDisplay(int32_t deviceId, ui::LogicalDisplayId displayId) = 0; Loading
services/inputflinger/reader/InputDevice.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -725,6 +725,15 @@ size_t InputDevice::getMapperCount() { return count; } std::optional<HardwareProperties> InputDevice::getTouchpadHardwareProperties() { std::optional<HardwareProperties> result = first_in_mappers<HardwareProperties>( [](InputMapper& mapper) -> std::optional<HardwareProperties> { return mapper.getTouchpadHardwareProperties(); }); return result; } void InputDevice::updateLedState(bool reset) { for_each_mapper([reset](InputMapper& mapper) { mapper.updateLedState(reset); }); } Loading
services/inputflinger/reader/InputReader.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include <utils/Thread.h> #include "InputDevice.h" #include "include/gestures.h" using android::base::StringPrintf; Loading Loading @@ -817,6 +818,18 @@ std::vector<InputDeviceSensorInfo> InputReader::getSensors(int32_t deviceId) { return device->getDeviceInfo().getSensors(); } std::optional<HardwareProperties> InputReader::getTouchpadHardwareProperties(int32_t deviceId) { std::scoped_lock _l(mLock); InputDevice* device = findInputDeviceLocked(deviceId); if (device == nullptr) { return {}; } return device->getTouchpadHardwareProperties(); } bool InputReader::setLightColor(int32_t deviceId, int32_t lightId, int32_t color) { std::scoped_lock _l(mLock); Loading
services/inputflinger/reader/include/InputDevice.h +2 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,8 @@ public: size_t getMapperCount(); std::optional<HardwareProperties> getTouchpadHardwareProperties(); // construct and add a mapper to the input device template <class T, typename... Args> T& addMapper(int32_t eventHubId, Args... args) { Loading
services/inputflinger/reader/include/InputReader.h +2 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,8 @@ public: std::vector<InputDeviceSensorInfo> getSensors(int32_t deviceId) override; std::optional<HardwareProperties> getTouchpadHardwareProperties(int32_t deviceId) override; bool setLightColor(int32_t deviceId, int32_t lightId, int32_t color) override; bool setLightPlayerId(int32_t deviceId, int32_t lightId, int32_t playerId) override; Loading