Add tests for pointer stuck in TouchState
Add two tests that reproduce the conditions necessary for the pointer to
be stuck inside TouchState.
In both cases, this is caused by calling
synthesizeCancelationEventsForConnectionLocked without also changing the
TouchState. That makes TouchState and InputState out of sync.
Currently, this setup does not cause a crash, but rather, just drops
some of the touches unexpectedly.
These tests are added as documentation of the current behaviour. When
the situation is fixed in the future, the tests would need to be
updated. If we wanted the tests to fail, we could crash the dispatcher
whenever InputState detects an inconsistent stream. A similar solution
will be done eventually by enabling the InputVerifier for all outgoing
streams.
Bug: 281806933
Test: m inputflinger_tests && adb sync data && adb shell -t data/nativetest64/inputflinger_tests/inputflinger_tests
Change-Id: Iaa949f2aa8dd2a7db9e8fd8bb365430e805cda79
diff --git a/services/inputflinger/dispatcher/Entry.cpp b/services/inputflinger/dispatcher/Entry.cpp
index b625a1b..a670ebe 100644
--- a/services/inputflinger/dispatcher/Entry.cpp
+++ b/services/inputflinger/dispatcher/Entry.cpp
@@ -352,7 +352,7 @@
entry.transform.dump(transform, "transform");
out << ", resolvedFlags=" << entry.resolvedFlags
<< ", targetFlags=" << entry.targetFlags.string() << ", transform=" << transform
- << "} original =" << entry.eventEntry->getDescription();
+ << "} original: " << entry.eventEntry->getDescription();
return out;
}