Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf069a34 authored by Linnan Li's avatar Linnan Li Committed by Cherrypicker Worker
Browse files

Do not slide event into the new window which can't receive motion event



When we slide an event into a new window, we should check if the window
 can receive motion events to prevent incorrect dispatching of events.

Bug: None
Test: atest inputflinger_tests

Signed-off-by: default avatarLinnan Li <lilinnan@xiaomi.corp-partner.google.com>
(cherry picked from https://partner-android-review.googlesource.com/q/commit:76f89b7a1bac7a3be2fc8f5b990e39a45a265afa)
Merged-In: Idc604c4db40f77ee682b88060b9e9d3f33c594aa
Change-Id: Idc604c4db40f77ee682b88060b9e9d3f33c594aa
parent ec3ef50f
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -2558,9 +2558,9 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked(
                return {};
                return {};
            }
            }


            // Drop touch events if requested by input feature
            // Do not slide events to the window which can not receive motion event
            if (newTouchedWindowHandle != nullptr &&
            if (newTouchedWindowHandle != nullptr &&
                shouldDropInput(entry, newTouchedWindowHandle)) {
                !canWindowReceiveMotionLocked(newTouchedWindowHandle, entry)) {
                newTouchedWindowHandle = nullptr;
                newTouchedWindowHandle = nullptr;
            }
            }