diff options
author | Haamed Gheibi <haamed@google.com> | 2021-07-12 20:47:19 +0000 |
---|---|---|
committer | Haamed Gheibi <haamed@google.com> | 2021-07-14 18:34:05 +0000 |
commit | bfcbf7547575a41e558fddb950f852d0911a9eab (patch) | |
tree | 034cca7e35f896a97a8cd6759c2100a9a072f972 /include | |
parent | 0d56a98e3d966ff62e955610690714cf0d9bcab2 (diff) | |
parent | b1889c5fa7539c0321f98ade85d518297d9b4815 (diff) |
Merge SP1A.210709.002
Change-Id: I1320e500a404b187169775b05d01095bf95a5818
Diffstat (limited to 'include')
-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 e8678d27c3..2e326cb102 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. @@ -222,16 +240,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. |