Reconfigure device in TouchInputMapper when the type is changed.
A race condition may occur where the device type change is only
propagated after the device is created. In this case the device
should be fully reconfigured.
BUG: 262887935
Test: CtsHardwareTestCases:android.hardware.input.cts.tests.VirtualNavigationTouchpadTest
Change-Id: Iced2e2c5af2a6f33c1299f2d0d1c30ca36a62e3c
(cherry picked from commit 1588a2e58751a357b32102ab013a7e2ab996efad)
diff --git a/services/inputflinger/tests/InputMapperTest.cpp b/services/inputflinger/tests/InputMapperTest.cpp
index a02ef05..ae30006 100644
--- a/services/inputflinger/tests/InputMapperTest.cpp
+++ b/services/inputflinger/tests/InputMapperTest.cpp
@@ -54,7 +54,8 @@
if (!changes ||
(changes &
(InputReaderConfiguration::CHANGE_DISPLAY_INFO |
- InputReaderConfiguration::CHANGE_POINTER_CAPTURE))) {
+ InputReaderConfiguration::CHANGE_POINTER_CAPTURE |
+ InputReaderConfiguration::CHANGE_DEVICE_TYPE))) {
mReader->requestRefreshConfiguration(changes);
mReader->loopOnce();
}