TouchedWindow: store tool type in addition to pointer id
Before this CL, we only stored the touching pointer id's inside
TouchWindow. However, it is also necessary to know which of the touching
pointers are touch vs stylus. This would allow us in a later CL to
determine whether the stylus is currently down anywhere on screen.
In this CL, instead of storing just the pointer ids, store
PointerProperties in a vector. This includes the pointer id and the
tooltype.
There should be no behaviour change in this CL.
Bug: 316225294
Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST
Change-Id: I7fb2bbd46e7da7e085679ee16da3a53773931875
diff --git a/services/inputflinger/tests/InputDispatcher_test.cpp b/services/inputflinger/tests/InputDispatcher_test.cpp
index 9394995..9eb322e 100644
--- a/services/inputflinger/tests/InputDispatcher_test.cpp
+++ b/services/inputflinger/tests/InputDispatcher_test.cpp
@@ -9692,7 +9692,7 @@
// Receives cancel for first pointer after next pointer down
mSpyWindow->consumeMotionEvent(WithMotionAction(ACTION_CANCEL));
- mSpyWindow->consumeMotionEvent(WithMotionAction(ACTION_DOWN));
+ mSpyWindow->consumeMotionEvent(AllOf(WithMotionAction(ACTION_DOWN), WithPointerIds({1})));
mDragWindow->consumeMotionEvent(WithMotionAction(ACTION_MOVE));
mSpyWindow->assertNoEvents();