Allow multiple input device in the same window
With this change, all restrictions about only having a single input
device active in a window are lifted.
The window will get multiple input devices at once.
21 native tests were forked in this CL to reflect the new behaviour.
Bug: 211379801
Test: navigate settings with touch + stylus at the same time
Test: swipe inside IME with touch + stylus
Test: draw in test app with touch + stylus
Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST
Change-Id: I259c0c87e47a1fa3090cddba6a595cf032877bb2
diff --git a/services/inputflinger/tests/FakeWindows.cpp b/services/inputflinger/tests/FakeWindows.cpp
index 0ac2f0f..bfe09bc 100644
--- a/services/inputflinger/tests/FakeWindows.cpp
+++ b/services/inputflinger/tests/FakeWindows.cpp
@@ -298,16 +298,18 @@
const ::testing::Matcher<MotionEvent>& matcher) {
std::unique_ptr<InputEvent> event = consume(CONSUME_TIMEOUT_EVENT_EXPECTED);
if (event == nullptr) {
- ADD_FAILURE() << "No event";
+ std::ostringstream matcherDescription;
+ matcher.DescribeTo(&matcherDescription);
+ ADD_FAILURE() << "No event (expected " << matcherDescription.str() << ") on " << mName;
return nullptr;
}
if (event->getType() != InputEventType::MOTION) {
- ADD_FAILURE() << "Instead of motion event, got " << *event;
+ ADD_FAILURE() << "Instead of motion event, got " << *event << " on " << mName;
return nullptr;
}
std::unique_ptr<MotionEvent> motionEvent =
std::unique_ptr<MotionEvent>(static_cast<MotionEvent*>(event.release()));
- EXPECT_THAT(*motionEvent, matcher);
+ EXPECT_THAT(*motionEvent, matcher) << " on " << mName;
return motionEvent;
}