Loading libs/input/input_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -34,3 +34,10 @@ flag { description: "Set to true to enable multi-device input: touch and stylus can be active at the same time, but in different windows" bug: "211379801" } flag { name: "a11y_crash_on_inconsistent_event_stream" namespace: "accessibility" description: "Brings back fatal logging for inconsistent event streams originating from accessibility." bug: "299977100" } services/inputflinger/dispatcher/InputDispatcher.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <android-base/stringprintf.h> #include <android/os/IInputConstants.h> #include <binder/Binder.h> #include <com_android_input_flags.h> #include <ftl/enum.h> #include <log/log_event_list.h> #if defined(__ANDROID__) Loading Loading @@ -67,6 +68,7 @@ using android::gui::WindowInfo; using android::gui::WindowInfoHandle; using android::os::InputEventInjectionResult; using android::os::InputEventInjectionSync; namespace input_flags = com::android::input::flags; namespace android::inputdispatcher { Loading Loading @@ -670,11 +672,11 @@ std::vector<TouchedWindow> getHoveringWindowsLocked(const TouchState* oldState, // This pointer was already sent to the window. Use ACTION_HOVER_MOVE. if (CC_UNLIKELY(maskedAction != AMOTION_EVENT_ACTION_HOVER_MOVE)) { android::base::LogSeverity severity = android::base::LogSeverity::FATAL; if (entry.flags & AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT) { if (!input_flags::a11y_crash_on_inconsistent_event_stream() && 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(); Loading services/inputflinger/tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ cc_test { }, }, static_libs: [ "libflagtest", "libc++fs", "libgmock", ], Loading services/inputflinger/tests/InputDispatcher_test.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,9 @@ #include <android-base/stringprintf.h> #include <android-base/thread_annotations.h> #include <binder/Binder.h> #include <com_android_input_flags.h> #include <fcntl.h> #include <flag_macros.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <input/Input.h> Loading Loading @@ -3838,7 +3840,9 @@ TEST_F(InputDispatcherTest, HoverExitIsSentToRemovedWindow) { /** * Test that invalid HOVER events sent by accessibility do not cause a fatal crash. */ TEST_F(InputDispatcherTest, InvalidA11yHoverStreamDoesNotCrash) { TEST_F_WITH_FLAGS(InputDispatcherTest, InvalidA11yHoverStreamDoesNotCrash, REQUIRES_FLAGS_DISABLED(ACONFIG_FLAG(com::android::input::flags, a11y_crash_on_inconsistent_event_stream))) { std::shared_ptr<FakeApplicationHandle> application = std::make_shared<FakeApplicationHandle>(); sp<FakeWindowHandle> window = sp<FakeWindowHandle>::make(application, mDispatcher, "Window", ADISPLAY_ID_DEFAULT); Loading Loading
libs/input/input_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -34,3 +34,10 @@ flag { description: "Set to true to enable multi-device input: touch and stylus can be active at the same time, but in different windows" bug: "211379801" } flag { name: "a11y_crash_on_inconsistent_event_stream" namespace: "accessibility" description: "Brings back fatal logging for inconsistent event streams originating from accessibility." bug: "299977100" }
services/inputflinger/dispatcher/InputDispatcher.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <android-base/stringprintf.h> #include <android/os/IInputConstants.h> #include <binder/Binder.h> #include <com_android_input_flags.h> #include <ftl/enum.h> #include <log/log_event_list.h> #if defined(__ANDROID__) Loading Loading @@ -67,6 +68,7 @@ using android::gui::WindowInfo; using android::gui::WindowInfoHandle; using android::os::InputEventInjectionResult; using android::os::InputEventInjectionSync; namespace input_flags = com::android::input::flags; namespace android::inputdispatcher { Loading Loading @@ -670,11 +672,11 @@ std::vector<TouchedWindow> getHoveringWindowsLocked(const TouchState* oldState, // This pointer was already sent to the window. Use ACTION_HOVER_MOVE. if (CC_UNLIKELY(maskedAction != AMOTION_EVENT_ACTION_HOVER_MOVE)) { android::base::LogSeverity severity = android::base::LogSeverity::FATAL; if (entry.flags & AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT) { if (!input_flags::a11y_crash_on_inconsistent_event_stream() && 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(); Loading
services/inputflinger/tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ cc_test { }, }, static_libs: [ "libflagtest", "libc++fs", "libgmock", ], Loading
services/inputflinger/tests/InputDispatcher_test.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,9 @@ #include <android-base/stringprintf.h> #include <android-base/thread_annotations.h> #include <binder/Binder.h> #include <com_android_input_flags.h> #include <fcntl.h> #include <flag_macros.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <input/Input.h> Loading Loading @@ -3838,7 +3840,9 @@ TEST_F(InputDispatcherTest, HoverExitIsSentToRemovedWindow) { /** * Test that invalid HOVER events sent by accessibility do not cause a fatal crash. */ TEST_F(InputDispatcherTest, InvalidA11yHoverStreamDoesNotCrash) { TEST_F_WITH_FLAGS(InputDispatcherTest, InvalidA11yHoverStreamDoesNotCrash, REQUIRES_FLAGS_DISABLED(ACONFIG_FLAG(com::android::input::flags, a11y_crash_on_inconsistent_event_stream))) { std::shared_ptr<FakeApplicationHandle> application = std::make_shared<FakeApplicationHandle>(); sp<FakeWindowHandle> window = sp<FakeWindowHandle>::make(application, mDispatcher, "Window", ADISPLAY_ID_DEFAULT); Loading