summaryrefslogtreecommitdiff
path: root/core/java/android/view/WindowManagerPolicyConstants.java
diff options
context:
space:
mode:
authorSiarhei Vishniakou <svv@google.com>2021-05-21 05:28:09 +0000
committerSiarhei Vishniakou <svv@google.com>2021-06-04 21:15:43 +0000
commit12144442602f8facfa90dc91e52fbde0a6d23b88 (patch)
tree5f4959a5076244db20fa543b4efc46f33fe142f1 /core/java/android/view/WindowManagerPolicyConstants.java
parent6b5bbd62f98165940d348c0a707f2bced4203a15 (diff)
Remove FLAG_INPUTFILTER_TRUSTED in MotionEventInjector
All input events coming into inputfilter from InputDispatcher will now have FLAG_INPUTFILTER_TRUSTED set by default. It is now up to the inputfilter (a11y) to remove this flag when appropriate. One such case is where an unknown a11y service is injecting the events. From auditing the a11y code, the only such place is MotionEventInjector. Therefore, label all events coming out of MotionEventInjector as "untrusted" by removing this new flag INPUTFILTER_TRUSTED. Separately, a11y should be distinguishable from regularly injected input events. To tell apart the events injected by a11y, add a new flag, FLAG_INJECTED_FROM_ACCESSIBILITY. This flag requests InputDispatcher to apply the device id = -2 for the injected events. Test: atest CtsInputTestCases:android.input.cts.GamepadWithAccessibilityTest Test: atest MotionEventInjectorTest Bug: 175069843 Change-Id: I12d4a7bd6fbab8af202f5ae88b6be97ff9e1754c
Diffstat (limited to 'core/java/android/view/WindowManagerPolicyConstants.java')
-rw-r--r--core/java/android/view/WindowManagerPolicyConstants.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/view/WindowManagerPolicyConstants.java b/core/java/android/view/WindowManagerPolicyConstants.java
index 7668d80d3cb1..81c934dffa47 100644
--- a/core/java/android/view/WindowManagerPolicyConstants.java
+++ b/core/java/android/view/WindowManagerPolicyConstants.java
@@ -16,6 +16,9 @@
package android.view;
+import static android.os.IInputConstants.POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY;
+import static android.os.IInputConstants.POLICY_FLAG_INPUTFILTER_TRUSTED;
+
import android.annotation.IntDef;
import android.os.PowerManager;
@@ -27,10 +30,13 @@ import java.lang.annotation.RetentionPolicy;
* @hide
*/
public interface WindowManagerPolicyConstants {
- // Policy flags. These flags are also defined in frameworks/base/include/ui/Input.h.
+ // Policy flags. These flags are also defined in frameworks/base/include/ui/Input.h and
+ // frameworks/native/libs/input/android/os/IInputConstants.aidl
int FLAG_WAKE = 0x00000001;
int FLAG_VIRTUAL = 0x00000002;
+ int FLAG_INPUTFILTER_TRUSTED = POLICY_FLAG_INPUTFILTER_TRUSTED;
+ int FLAG_INJECTED_FROM_ACCESSIBILITY = POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY;
int FLAG_INJECTED = 0x01000000;
int FLAG_TRUSTED = 0x02000000;
int FLAG_FILTERED = 0x04000000;