InputMapper refactor: TouchpadInputMapper
Add a factory method for TouchpadInputMapper to be configured on
initilisation
Test: m checkinput && atest libinput_tests inputflinger_tests
Bug: 256009910
Change-Id: I1189eede635330b24f3f1175d2aa4b46775362b7
(cherry picked from commit 04e643ceacce438363afb521b7a1ff429562aab7)
diff --git a/services/inputflinger/reader/mapper/TouchpadInputMapper.h b/services/inputflinger/reader/mapper/TouchpadInputMapper.h
index 3128d18..23d0fd3 100644
--- a/services/inputflinger/reader/mapper/TouchpadInputMapper.h
+++ b/services/inputflinger/reader/mapper/TouchpadInputMapper.h
@@ -40,8 +40,10 @@
class TouchpadInputMapper : public InputMapper {
public:
- explicit TouchpadInputMapper(InputDeviceContext& deviceContext,
- const InputReaderConfiguration& readerConfig);
+ template <class T, class... Args>
+ friend std::unique_ptr<T> createInputMapper(InputDeviceContext& deviceContext,
+ const InputReaderConfiguration& readerConfig,
+ Args... args);
~TouchpadInputMapper();
uint32_t getSources() const override;
@@ -58,6 +60,8 @@
private:
void resetGestureInterpreter(nsecs_t when);
+ explicit TouchpadInputMapper(InputDeviceContext& deviceContext,
+ const InputReaderConfiguration& readerConfig);
[[nodiscard]] std::list<NotifyArgs> sendHardwareState(nsecs_t when, nsecs_t readTime,
SelfContainedHardwareState schs);
[[nodiscard]] std::list<NotifyArgs> processGestures(nsecs_t when, nsecs_t readTime);