Log dispatch state when pointers overlap
We are still receiving reports in go/crashes for overlapping pointers,
both internally and externally.
The reports appear to be limited to test scenarios.
To help debug these failures, log dispatcher state whenever we encounter
overlapping pointers.
Bug: 332186379
Test: TEST=inputflinger_tests; m $TEST && adb sync && adb shell -t /data/nativetest64/$TEST/$TEST
Change-Id: I38d6b7a777f00e734ada06e4d6f53fb752007b83
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index fa62fa4..ccd913e 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -3061,7 +3061,11 @@
<< ", windowInfo->globalScaleFactor=" << windowInfo->globalScaleFactor;
}
- it->addPointers(pointerIds, windowInfo->transform);
+ Result<void> result = it->addPointers(pointerIds, windowInfo->transform);
+ if (!result.ok()) {
+ logDispatchStateLocked();
+ LOG(FATAL) << result.error().message();
+ }
}
void InputDispatcher::addGlobalMonitoringTargetsLocked(std::vector<InputTarget>& inputTargets,