Loading libs/input/Android.bp +17 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,21 @@ filegroup { ], } ///////////////////////////////////////////////// // flags ///////////////////////////////////////////////// aconfig_declarations { name: "aconfig_input_flags", package: "com.android.input.flags", srcs: ["input_flags.aconfig"], } cc_aconfig_library { name: "aconfig_input_flags_c_lib", aconfig_declarations: "aconfig_input_flags", host_supported: true, } aidl_interface { name: "inputconstants", host_supported: true, Loading Loading @@ -176,6 +191,7 @@ cc_library { "libtinyxml2", "libutils", "libvintf", "server_configurable_flags", ], ldflags: [ Loading @@ -196,6 +212,7 @@ cc_library { ], whole_static_libs: [ "aconfig_input_flags_c_lib", "libinput_rust_ffi", ], Loading libs/input/InputTransport.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -23,9 +23,12 @@ #include <log/log.h> #include <utils/Trace.h> #include <com_android_input_flags.h> #include <input/InputTransport.h> #include <input/TraceTools.h> namespace input_flags = com::android::input::flags; namespace { /** Loading Loading @@ -139,7 +142,8 @@ static const char* PROPERTY_RESAMPLING_ENABLED = "ro.input.resampling"; * Enable this via "adb shell setprop log.tag.InputTransportVerifyEvents DEBUG" */ static bool verifyEvents() { return __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "VerifyEvents", ANDROID_LOG_INFO); return input_flags::enable_outbound_event_verification() || __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "VerifyEvents", ANDROID_LOG_INFO); } template<typename T> Loading libs/input/input_flags.aconfig 0 → 100644 +15 −0 Original line number Diff line number Diff line package: "com.android.input.flags" flag { name: "enable_outbound_event_verification" namespace: "input" description: "Set to true to enable crashing whenever bad outbound events are detected inside InputTransport" bug: "271455682" } flag { name: "enable_inbound_event_verification" namespace: "input" description: "Set to true to enable crashing whenever bad inbound events are going into InputDispatcher" bug: "271455682" } libs/input/tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ cc_test { "libtinyxml2", "libutils", "libvintf", "server_configurable_flags", ], data: [ "data/*", Loading services/inputflinger/dispatcher/DebugConfig.h +4 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,9 @@ #define LOG_TAG "InputDispatcher" #include <android-base/logging.h> #include <com_android_input_flags.h> namespace input_flags = com::android::input::flags; namespace android::inputdispatcher { Loading Loading @@ -102,7 +105,7 @@ const bool DEBUG_HOVER = * Crash if a bad stream from InputListener is detected. * Enable this via "adb shell setprop log.tag.InputDispatcherVerifyEvents DEBUG" (requires restart) */ const bool DEBUG_VERIFY_EVENTS = const bool DEBUG_VERIFY_EVENTS = input_flags::enable_inbound_event_verification() || android::base::ShouldLog(android::base::LogSeverity::DEBUG, LOG_TAG "VerifyEvents"); } // namespace android::inputdispatcher Loading
libs/input/Android.bp +17 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,21 @@ filegroup { ], } ///////////////////////////////////////////////// // flags ///////////////////////////////////////////////// aconfig_declarations { name: "aconfig_input_flags", package: "com.android.input.flags", srcs: ["input_flags.aconfig"], } cc_aconfig_library { name: "aconfig_input_flags_c_lib", aconfig_declarations: "aconfig_input_flags", host_supported: true, } aidl_interface { name: "inputconstants", host_supported: true, Loading Loading @@ -176,6 +191,7 @@ cc_library { "libtinyxml2", "libutils", "libvintf", "server_configurable_flags", ], ldflags: [ Loading @@ -196,6 +212,7 @@ cc_library { ], whole_static_libs: [ "aconfig_input_flags_c_lib", "libinput_rust_ffi", ], Loading
libs/input/InputTransport.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -23,9 +23,12 @@ #include <log/log.h> #include <utils/Trace.h> #include <com_android_input_flags.h> #include <input/InputTransport.h> #include <input/TraceTools.h> namespace input_flags = com::android::input::flags; namespace { /** Loading Loading @@ -139,7 +142,8 @@ static const char* PROPERTY_RESAMPLING_ENABLED = "ro.input.resampling"; * Enable this via "adb shell setprop log.tag.InputTransportVerifyEvents DEBUG" */ static bool verifyEvents() { return __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "VerifyEvents", ANDROID_LOG_INFO); return input_flags::enable_outbound_event_verification() || __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "VerifyEvents", ANDROID_LOG_INFO); } template<typename T> Loading
libs/input/input_flags.aconfig 0 → 100644 +15 −0 Original line number Diff line number Diff line package: "com.android.input.flags" flag { name: "enable_outbound_event_verification" namespace: "input" description: "Set to true to enable crashing whenever bad outbound events are detected inside InputTransport" bug: "271455682" } flag { name: "enable_inbound_event_verification" namespace: "input" description: "Set to true to enable crashing whenever bad inbound events are going into InputDispatcher" bug: "271455682" }
libs/input/tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ cc_test { "libtinyxml2", "libutils", "libvintf", "server_configurable_flags", ], data: [ "data/*", Loading
services/inputflinger/dispatcher/DebugConfig.h +4 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,9 @@ #define LOG_TAG "InputDispatcher" #include <android-base/logging.h> #include <com_android_input_flags.h> namespace input_flags = com::android::input::flags; namespace android::inputdispatcher { Loading Loading @@ -102,7 +105,7 @@ const bool DEBUG_HOVER = * Crash if a bad stream from InputListener is detected. * Enable this via "adb shell setprop log.tag.InputDispatcherVerifyEvents DEBUG" (requires restart) */ const bool DEBUG_VERIFY_EVENTS = const bool DEBUG_VERIFY_EVENTS = input_flags::enable_inbound_event_verification() || android::base::ShouldLog(android::base::LogSeverity::DEBUG, LOG_TAG "VerifyEvents"); } // namespace android::inputdispatcher