InputMapper refactor: Configure empty InputDevice
Configure the Device prior to populating mappers for mappers to
receive correct property map
Test: atest inputflinger_tests
Bug: 256009910
Change-Id: I0a7d2bf4d64b3d120d9050e9154b3f3a0f54657a
diff --git a/services/inputflinger/reader/InputReader.cpp b/services/inputflinger/reader/InputReader.cpp
index 7f63355..0aea0b3 100644
--- a/services/inputflinger/reader/InputReader.cpp
+++ b/services/inputflinger/reader/InputReader.cpp
@@ -236,7 +236,7 @@
}
InputDeviceIdentifier identifier = mEventHub->getDeviceIdentifier(eventHubId);
- std::shared_ptr<InputDevice> device = createDeviceLocked(eventHubId, identifier);
+ std::shared_ptr<InputDevice> device = createDeviceLocked(when, eventHubId, identifier);
mPendingArgs += device->configure(when, mConfig, /*changes=*/{});
mPendingArgs += device->reset(when);
@@ -319,7 +319,7 @@
}
std::shared_ptr<InputDevice> InputReader::createDeviceLocked(
- int32_t eventHubId, const InputDeviceIdentifier& identifier) {
+ nsecs_t when, int32_t eventHubId, const InputDeviceIdentifier& identifier) {
auto deviceIt = std::find_if(mDevices.begin(), mDevices.end(), [identifier](auto& devicePair) {
const InputDeviceIdentifier identifier2 =
devicePair.second->getDeviceInfo().getIdentifier();
@@ -334,7 +334,7 @@
device = std::make_shared<InputDevice>(&mContext, deviceId, bumpGenerationLocked(),
identifier);
}
- device->addEventHubDevice(eventHubId, mConfig);
+ mPendingArgs += device->addEventHubDevice(when, eventHubId, mConfig);
return device;
}