diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2021-07-01 03:43:03 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-07-01 03:43:03 +0000 |
commit | 1e7186ae152e724e58c94444266bd93eb9e3fd32 (patch) | |
tree | 56588730ab9978545cf04d9e6eaf73802f4c3ce7 /include/input | |
parent | bef8b8525f0d008b63aee956b10535480894483d (diff) | |
parent | 61cfde719b9dac7d718a0af72c3a8748d0f7ffe7 (diff) | |
download | native-1e7186ae152e724e58c94444266bd93eb9e3fd32.tar.gz |
Merge "Set FLAG_IS_ACCESSIBILITY_EVENT for events injected from accessibility" into sc-dev am: 61cfde719b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15019654
Change-Id: I8dae253b5b0a54beb9696d3e6e2395be6b3a08e6
Diffstat (limited to 'include/input')
-rw-r--r-- | include/input/Input.h | 30 | ||||
-rw-r--r-- | include/input/InputDevice.h | 2 |
2 files changed, 23 insertions, 9 deletions
diff --git a/include/input/Input.h b/include/input/Input.h index 68d08725e9..296b47a099 100644 --- a/include/input/Input.h +++ b/include/input/Input.h @@ -43,6 +43,13 @@ * Additional private constants not defined in ndk/ui/input.h. */ enum { +#ifdef __linux__ + /* This event was generated or modified by accessibility service. */ + AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = + android::os::IInputConstants::INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT, // 0x800, +#else + AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; +#endif /* Signifies that the key is being predispatched */ AKEY_EVENT_FLAG_PREDISPATCH = 0x20000000, @@ -81,6 +88,16 @@ enum { */ AMOTION_EVENT_FLAG_NO_FOCUS_CHANGE = 0x40, +#ifdef __linux__ + /** + * This event was generated or modified by accessibility service. + */ + AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = + android::os::IInputConstants::INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT, // 0x800, +#else + AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800; +#endif + /* Motion event is inconsistent with previously sent motion events. */ AMOTION_EVENT_FLAG_TAINTED = 0x80000000, }; @@ -89,14 +106,15 @@ enum { * Allowed VerifiedKeyEvent flags. All other flags from KeyEvent do not get verified. * These values must be kept in sync with VerifiedKeyEvent.java */ -constexpr int32_t VERIFIED_KEY_EVENT_FLAGS = AKEY_EVENT_FLAG_CANCELED; +constexpr int32_t VERIFIED_KEY_EVENT_FLAGS = + AKEY_EVENT_FLAG_CANCELED | AKEY_EVENT_FLAG_IS_ACCESSIBILITY_EVENT; /** * Allowed VerifiedMotionEventFlags. All other flags from MotionEvent do not get verified. * These values must be kept in sync with VerifiedMotionEvent.java */ -constexpr int32_t VERIFIED_MOTION_EVENT_FLAGS = - AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED | AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED; +constexpr int32_t VERIFIED_MOTION_EVENT_FLAGS = AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED | + AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED | AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT; /** * This flag indicates that the point up event has been canceled. @@ -213,16 +231,14 @@ enum { POLICY_FLAG_GESTURE = 0x00000008, POLICY_FLAG_RAW_MASK = 0x0000ffff, -#ifdef __linux__ - POLICY_FLAG_INPUTFILTER_TRUSTED = android::os::IInputConstants::POLICY_FLAG_INPUTFILTER_TRUSTED, +#ifdef __linux__ POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = android::os::IInputConstants::POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY, #else - POLICY_FLAG_INPUTFILTER_TRUSTED = 0x10000, - POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000, #endif + /* These flags are set by the input dispatcher. */ // Indicates that the input event was injected. diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h index 1955104a22..7f0324a4a8 100644 --- a/include/input/InputDevice.h +++ b/include/input/InputDevice.h @@ -318,8 +318,6 @@ extern std::string getInputDeviceConfigurationFilePathByName( const std::string& name, InputDeviceConfigurationFileType type); enum ReservedInputDeviceId : int32_t { - // Device id assigned to input events generated inside accessibility service - ACCESSIBILITY_DEVICE_ID = -2, // Device id of a special "virtual" keyboard that is always present. VIRTUAL_KEYBOARD_ID = -1, // Device id of the "built-in" keyboard if there is one. |