commit | bf069a34aa71dff8375b563a9927941936f70113 | [log] [tgz] |
---|---|---|
author | Linnan Li <lilinnan@xiaomi.corp-partner.google.com> | Thu Feb 29 17:22:59 2024 +0000 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Thu Feb 29 17:22:59 2024 +0000 |
tree | e53f99b9c88e7c348518326fe7f01ca235de49c6 | |
parent | ec3ef50f1dbc57d3e57ae81ec26c9e7ed8735034 [diff] [blame] |
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: Linnan 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
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp index 8858f0c..7f54bf1 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.cpp +++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -2558,9 +2558,9 @@ 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 && - shouldDropInput(entry, newTouchedWindowHandle)) { + !canWindowReceiveMotionLocked(newTouchedWindowHandle, entry)) { newTouchedWindowHandle = nullptr; }