Set FLAG_IS_ACCESSIBILITY_EVENT for events injected from accessibility
If an input event was modified or injected by accessibility, set the
appropriate flag. This helps applications distinguish the real hardware
events from synthesized events.
This also allows a11y services more flexibility in modifying the event
streams coming from real hardware.
Bug: 152399927
Bug: 175069843
Test: atest inputflinger_tests libinput_tests
Change-Id: I805cba4c84582fa4cd4e0892ec00428d4b255ec6
diff --git a/libs/input/android/os/IInputConstants.aidl b/libs/input/android/os/IInputConstants.aidl
index 3038d9d..474a1e4 100644
--- a/libs/input/android/os/IInputConstants.aidl
+++ b/libs/input/android/os/IInputConstants.aidl
@@ -42,16 +42,15 @@
const int INVALID_INPUT_EVENT_ID = 0;
/**
- * The injected event was originally sent from InputDispatcher. Most likely, the journey of the
- * event looked as follows:
- * InputDispatcherPolicyInterface::filterInputEvent -> InputFilter.java::onInputEvent ->
- * InputFilter.java::sendInputEvent -> InputDispatcher::injectInputEvent, without being modified
- * along the way.
- */
- const int POLICY_FLAG_INPUTFILTER_TRUSTED = 0x10000;
-
- /**
- * The input event was injected from accessibility
+ * The input event was injected from accessibility. Used in policyFlags for input event
+ * injection.
*/
const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000;
+
+ /**
+ * The input event was generated or modified by accessibility service.
+ * Shared by both KeyEvent and MotionEvent flags, so this value should not overlap with either
+ * set of flags, including in input/Input.h and in android/input.h.
+ */
+ const int INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800;
}