Lower severity for invalid accessibility hover event stream to ERROR.
LOG(FATAL) crashes the device, which is very severe for the user.
The accessibility hover event stream has consistency issues that we
are actively fixing, but these fixes have not yet had time to soak.
Instead of cherrypicking the fix, instead we can demote the severity
of the log so that errors do not crash the device.
NOTE: This unflagged change is reverting main to be identical to
udc-dev. In a followup we will use flagging to gradually roll out
the FATAL log.
Bug: 299977100
Bug: 286037469
Test: atest InputDispatcherTest#InvalidA11yHoverStreamDoesNotCrash
Test: Use talkback, repeatedly enter touch exploration while also
tapping with another finger. Eventually observe the failure
message which is now an ERROR instead of crashing the device
with a FATAL.
Change-Id: Iceea086345691cdad8ca5e092629de094d666de1
(cherry picked from commit 2f99cdb9150461c6b77c29b31cbf5792a9303c95)
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index d98641e..0a1e889 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -668,7 +668,15 @@
} else {
// This pointer was already sent to the window. Use ACTION_HOVER_MOVE.
if (CC_UNLIKELY(maskedAction != AMOTION_EVENT_ACTION_HOVER_MOVE)) {
- LOG(FATAL) << "Expected ACTION_HOVER_MOVE instead of " << entry.getDescription();
+ android::base::LogSeverity severity = android::base::LogSeverity::FATAL;
+ if (entry.flags & AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT) {
+ // The Accessibility injected touch exploration event stream
+ // has known inconsistencies, so log ERROR instead of
+ // crashing the device with FATAL.
+ // TODO(b/299977100): Move a11y severity back to FATAL.
+ severity = android::base::LogSeverity::ERROR;
+ }
+ LOG(severity) << "Expected ACTION_HOVER_MOVE instead of " << entry.getDescription();
}
touchedWindow.targetFlags = InputTarget::Flags::DISPATCH_AS_IS;
}