@@ -1333,7 +1333,7 @@ bool InputDispatcher::shouldPruneInboundQueueLocked(const MotionEntry& motionEnt
13331333 const bool isStylus = isPointerFromStylus (motionEntry, /* pointerIndex=*/ 0 );
13341334
13351335 sp<WindowInfoHandle> touchedWindowHandle =
1336- findTouchedWindowAtLocked (displayId, x, y, isStylus);
1336+ mWindowInfos . findTouchedWindowAt (displayId, x, y, isStylus);
13371337 if (touchedWindowHandle != nullptr &&
13381338 touchedWindowHandle->getApplicationToken () !=
13391339 mAwaitedFocusedApplication ->getApplicationToken ()) {
@@ -1452,20 +1452,19 @@ void InputDispatcher::addRecentEventLocked(std::shared_ptr<const EventEntry> ent
14521452 }
14531453}
14541454
1455- sp<WindowInfoHandle> InputDispatcher::findTouchedWindowAtLocked (ui::LogicalDisplayId displayId,
1456- float x, float y, bool isStylus,
1457- bool ignoreDragWindow ) const {
1455+ sp<WindowInfoHandle> InputDispatcher::DispatcherWindowInfo::findTouchedWindowAt (
1456+ ui::LogicalDisplayId displayId, float x, float y, bool isStylus,
1457+ const sp<android::gui::WindowInfoHandle> ignoreWindow ) const {
14581458 // Traverse windows from front to back to find touched window.
1459- const auto & windowHandles = mWindowInfos . getWindowHandlesForDisplay (displayId);
1459+ const auto & windowHandles = getWindowHandlesForDisplay (displayId);
14601460 for (const sp<WindowInfoHandle>& windowHandle : windowHandles) {
1461- if (ignoreDragWindow && haveSameToken (windowHandle, mDragState -> dragWindow )) {
1461+ if (ignoreWindow && haveSameToken (windowHandle, ignoreWindow )) {
14621462 continue ;
14631463 }
14641464
14651465 const WindowInfo& info = *windowHandle->getInfo ();
14661466 if (!info.isSpy () &&
1467- windowAcceptsTouchAt (info, displayId, x, y, isStylus,
1468- mWindowInfos .getDisplayTransform (displayId))) {
1467+ windowAcceptsTouchAt (info, displayId, x, y, isStylus, getDisplayTransform (displayId))) {
14691468 return windowHandle;
14701469 }
14711470 }
@@ -2474,7 +2473,7 @@ InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime, const Motio
24742473 // be a pointer that would generate ACTION_DOWN, *and* touch should not already be down.
24752474 const bool isStylus = isPointerFromStylus (entry, pointerIndex);
24762475 sp<WindowInfoHandle> newTouchedWindowHandle =
2477- findTouchedWindowAtLocked (displayId, x, y, isStylus);
2476+ mWindowInfos . findTouchedWindowAt (displayId, x, y, isStylus);
24782477
24792478 if (isDown) {
24802479 targets += findOutsideTargetsLocked (displayId, newTouchedWindowHandle, pointer.id );
@@ -2657,7 +2656,7 @@ InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime, const Motio
26572656 tempTouchState.getFirstForegroundWindowHandle (entry.deviceId );
26582657 LOG_ALWAYS_FATAL_IF (oldTouchedWindowHandle == nullptr );
26592658 sp<WindowInfoHandle> newTouchedWindowHandle =
2660- findTouchedWindowAtLocked (displayId, x, y, isStylus);
2659+ mWindowInfos . findTouchedWindowAt (displayId, x, y, isStylus);
26612660
26622661 // Verify targeted injection.
26632662 if (const auto err = verifyTargetedInjection (newTouchedWindowHandle, entry); err) {
@@ -2881,7 +2880,8 @@ void InputDispatcher::finishDragAndDrop(ui::LogicalDisplayId displayId, float x,
28812880 constexpr bool isStylus = false ;
28822881
28832882 sp<WindowInfoHandle> dropWindow =
2884- findTouchedWindowAtLocked (displayId, x, y, isStylus, /* ignoreDragWindow=*/ true );
2883+ mWindowInfos .findTouchedWindowAt (displayId, x, y, isStylus, /* ignoreWindow=*/
2884+ mDragState ->dragWindow );
28852885 if (dropWindow) {
28862886 vec2 local = dropWindow->getInfo ()->transform .transform (x, y);
28872887 sendDropWindowCommandLocked (dropWindow->getToken (), local.x , local.y );
@@ -2936,8 +2936,8 @@ void InputDispatcher::addDragEventLocked(const MotionEntry& entry) {
29362936 constexpr bool isStylus = false ;
29372937
29382938 sp<WindowInfoHandle> hoverWindowHandle =
2939- findTouchedWindowAtLocked (entry.displayId , x, y, isStylus,
2940- /* ignoreDragWindow =*/ true );
2939+ mWindowInfos . findTouchedWindowAt (entry.displayId , x, y, isStylus,
2940+ /* ignoreWindow =*/ mDragState -> dragWindow );
29412941 // enqueue drag exit if needed.
29422942 if (hoverWindowHandle != mDragState ->dragHoverWindowHandle &&
29432943 !haveSameToken (hoverWindowHandle, mDragState ->dragHoverWindowHandle )) {
0 commit comments