InputMapper refactor: SwitchInputMapper
Add a factory method for SwitchInputMapper to be configured on
initilisation
Test: m checkinput && atest libinput_tests inputflinger_tests
Bug: 256009910
Change-Id: Ib2d8e680f72a3e07202fc6e4db7a48e54528555f
diff --git a/services/inputflinger/tests/InputReader_test.cpp b/services/inputflinger/tests/InputReader_test.cpp
index c34dcac..7d0fe4d 100644
--- a/services/inputflinger/tests/InputReader_test.cpp
+++ b/services/inputflinger/tests/InputReader_test.cpp
@@ -2603,13 +2603,13 @@
};
TEST_F(SwitchInputMapperTest, GetSources) {
- SwitchInputMapper& mapper = addMapperAndConfigure<SwitchInputMapper>();
+ SwitchInputMapper& mapper = constructAndAddMapper<SwitchInputMapper>();
ASSERT_EQ(uint32_t(AINPUT_SOURCE_SWITCH), mapper.getSources());
}
TEST_F(SwitchInputMapperTest, GetSwitchState) {
- SwitchInputMapper& mapper = addMapperAndConfigure<SwitchInputMapper>();
+ SwitchInputMapper& mapper = constructAndAddMapper<SwitchInputMapper>();
mFakeEventHub->setSwitchState(EVENTHUB_ID, SW_LID, 1);
ASSERT_EQ(1, mapper.getSwitchState(AINPUT_SOURCE_ANY, SW_LID));
@@ -2619,7 +2619,7 @@
}
TEST_F(SwitchInputMapperTest, Process) {
- SwitchInputMapper& mapper = addMapperAndConfigure<SwitchInputMapper>();
+ SwitchInputMapper& mapper = constructAndAddMapper<SwitchInputMapper>();
std::list<NotifyArgs> out;
out = process(mapper, ARBITRARY_TIME, READ_TIME, EV_SW, SW_LID, 1);
ASSERT_TRUE(out.empty());