Should only add gesture monitors when first down
To prevent adding the duplicated gesture monitors when next pointer down.
Test: atest inputflinger_test
Bug: 201647070
Change-Id: Ia3a678085a95dfcb14b35fb8f4b52920054c6339
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index 4b07a21..c9397c3 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -2144,8 +2144,9 @@
// be delivered to a new window which supports split touch.
tempTouchState.split = true;
}
-
- tempTouchState.addGestureMonitors(newGestureMonitors);
+ if (isDown) {
+ tempTouchState.addGestureMonitors(newGestureMonitors);
+ }
} else {
/* Case 2: Pointer move, up, cancel or non-splittable pointer down. */