Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51787405 authored by Jimmy's avatar Jimmy
Browse files

Add INJECT_KEY_EVENTS permission

Adds a new privileged|signature permission that allows clients to
create and own a VirtualKeyboard which for inputting key injections
to the system. Injected events can be sent to any display.

DD: go/a11y-al-pk-dd

Bug: 402581709
Bug: 399464391
Test: N/A

Flag: com.android.hardware.input.create_virtual_keyboard_api

Change-Id: Iaeecb820778ba42376e8eb8e3af306c16b58f901
parent 2b6afb3a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ package android {
    field @Deprecated public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
    field @FlaggedApi("android.xr.xr_manifest_entries") public static final String IMPORT_XR_ANCHOR = "android.permission.IMPORT_XR_ANCHOR";
    field public static final String INJECT_EVENTS = "android.permission.INJECT_EVENTS";
    field @FlaggedApi("com.android.hardware.input.create_virtual_keyboard_api") public static final String INJECT_KEY_EVENTS = "android.permission.INJECT_KEY_EVENTS";
    field @FlaggedApi("android.content.pm.sdk_dependency_installer") public static final String INSTALL_DEPENDENCY_SHARED_LIBRARIES = "android.permission.INSTALL_DEPENDENCY_SHARED_LIBRARIES";
    field public static final String INSTALL_DPC_PACKAGES = "android.permission.INSTALL_DPC_PACKAGES";
    field public static final String INSTALL_DYNAMIC_SYSTEM = "android.permission.INSTALL_DYNAMIC_SYSTEM";
+12 −0
Original line number Diff line number Diff line
@@ -5584,6 +5584,18 @@
    <permission android:name="android.permission.INJECT_EVENTS"
        android:protectionLevel="signature" />

    <!-- @SystemApi Allows privileged applications to inject key events into the event stream by
         creating a virtual keyboard. Key events may be delivered to ANY window. Allows for
         arbitrary keycode injections (e.g. AKEYCODE_BRIGHTNESS_UP) and modifier events
         (e.g. META_META_ON + AKEYCODE_L).
         <p>Not for use by third-party applications.
         @hide
         @FlaggedApi(com.android.hardware.input.Flags.FLAG_CREATE_VIRTUAL_KEYBOARD_API)
    -->
    <permission android:name="android.permission.INJECT_KEY_EVENTS"
        android:protectionLevel="signature|privileged"
        android:featureFlag="com.android.hardware.input.create_virtual_keyboard_api" />

    <!-- @hide Allows an application to register an input filter which filters the stream
         of user events (keys, touch, trackball) before they are dispatched to any window. -->
    <permission android:name="android.permission.FILTER_EVENTS"