InputMapper refactor: TouchInputMapper
Add a factory method for TouchInputMapper(s) to be configured on
initilisation
Test: m checkinput && atest libinput_tests inputflinger_tests
Bug: 256009910
Change-Id: I738e2947ff98016e00c290365292ab01b04e7d26
diff --git a/services/inputflinger/tests/InputMapperTest.h b/services/inputflinger/tests/InputMapperTest.h
index d969034..2b6655c 100644
--- a/services/inputflinger/tests/InputMapperTest.h
+++ b/services/inputflinger/tests/InputMapperTest.h
@@ -73,6 +73,17 @@
return mapper;
}
+ template <class T, typename... Args>
+ T& constructAndAddMapper(Args... args) {
+ // ensure a device entry exists for this eventHubId
+ mDevice->addEmptyEventHubDevice(EVENTHUB_ID);
+ // configure the empty device
+ configureDevice(/*changes=*/{});
+
+ return mDevice->constructAndAddMapper<T>(EVENTHUB_ID, mFakePolicy->getReaderConfiguration(),
+ args...);
+ }
+
void setDisplayInfoAndReconfigure(int32_t displayId, int32_t width, int32_t height,
ui::Rotation orientation, const std::string& uniqueId,
std::optional<uint8_t> physicalPort,