Fix wallpaper window can't receive up event
If the wallpaper window is touchable and the above touched window has
`DUPLICATE_TOUCH_TO_WALLPAPER` flag, it would also deliver the same
touch event to the wallpaper window, and it have to set the
corresponding pointer ids to prevent it being erased in next pointer up.
Bug: 240308355
Test: atest inputflinger_tests
Change-Id: Ibf82b494e45e35babe9ba9f3dd1236fee8bcea6d
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index 6d30090..01aa221 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -2429,12 +2429,14 @@
if (info->displayId == displayId &&
windowHandle->getInfo()->inputConfig.test(
WindowInfo::InputConfig::IS_WALLPAPER)) {
+ BitSet32 pointerIds;
+ pointerIds.markBit(entry.pointerProperties[0].id);
tempTouchState.addOrUpdateWindow(windowHandle,
InputTarget::Flags::WINDOW_IS_OBSCURED |
InputTarget::Flags::
WINDOW_IS_PARTIALLY_OBSCURED |
InputTarget::Flags::DISPATCH_AS_IS,
- BitSet32(0), entry.eventTime);
+ pointerIds, entry.eventTime);
}
}
}