summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2019-07-25 09:59:17 -0700
committer android-build-team Robot <android-build-team-robot@google.com> 2019-08-01 00:18:50 +0000
commit1e8ff85be96097ed93d6250d0bb5b2262a664f8b (patch)
tree329ced80b7f9078e0e462975d878eff2e2629499
parent690eef6d7c3636dec9a08351babfa505fbfe6f82 (diff)
syncInputWindows for mouse events
Add back the syncInputWindows calls for mouse events, because there are tests that rely on this behaviour (they might inject only a few events, which is not very realistic, but we still have to support this). Bug: 137072767 Bug: 138263890 Test: atest android.view.cts.HoverTest Change-Id: I37b621bc6dc6a844ca86324962124bb06857b906 (cherry picked from commit 4be12ea1e26e303e1cb0b77a66048c3234c9470f)
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index fb57d73c9a21..436a5c729b86 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -7670,10 +7670,12 @@ public class WindowManagerService extends IWindowManager.Stub
isDown = motionEvent.getAction() == MotionEvent.ACTION_DOWN;
isUp = motionEvent.getAction() == MotionEvent.ACTION_UP;
}
+ final boolean isMouseEvent = ev.getSource() == InputDevice.SOURCE_MOUSE;
// For ACTION_DOWN, syncInputTransactions before injecting input.
+ // For all mouse events, also sync before injecting.
// For ACTION_UP, sync after injecting.
- if (isDown) {
+ if (isDown || isMouseEvent) {
syncInputTransactions();
}
final boolean result =