InputDispatcher: Fix pointer count when canceling a subset of pointers
There was a bug in the logic for calculating the pointer coords and
properties for canceling a subset of pointers. It was introduced when we
refactored storing the coords in a vector rather than using a
fixed-length array with a pointerCount variable in the following change:
I91b4a88ec5df3f017ade8a6e55be3d3c1281de75
Bug: 346342507
Test: atest inputflinger_tests
Flag: NONE bug fix
Change-Id: Ie9a5fbd5ba1fd75c53b7289a93573ec2d0d1947b
diff --git a/services/inputflinger/tests/FakeWindows.h b/services/inputflinger/tests/FakeWindows.h
index 36a8f00..ee65d3a 100644
--- a/services/inputflinger/tests/FakeWindows.h
+++ b/services/inputflinger/tests/FakeWindows.h
@@ -304,15 +304,11 @@
WithFlags(expectedFlags)));
}
- inline void consumeMotionPointerUp(
- int32_t pointerIdx,
- ui::LogicalDisplayId expectedDisplayId = ui::LogicalDisplayId::DEFAULT,
- int32_t expectedFlags = 0) {
+ inline void consumeMotionPointerUp(int32_t pointerIdx,
+ const ::testing::Matcher<MotionEvent>& matcher) {
const int32_t action = AMOTION_EVENT_ACTION_POINTER_UP |
(pointerIdx << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT);
- consumeMotionEvent(testing::AllOf(WithMotionAction(action),
- WithDisplayId(expectedDisplayId),
- WithFlags(expectedFlags)));
+ consumeMotionEvent(testing::AllOf(WithMotionAction(action), matcher));
}
inline void consumeMotionUp(