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

Commit 78502b2c authored by Josh Yang's avatar Josh Yang
Browse files

Add a new permission OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW

This permission will be used on wear os to allow foreground apps to
override KEYCODE_STEM_PRIMARY behavior.

Bug:308482931
Test: build success
Change-Id: I13278d6bf7058b4d664c90d6d6efd62b3cba976b
parent e2b283d9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -251,6 +251,7 @@ package android {
    field public static final String OBSERVE_SENSOR_PRIVACY = "android.permission.OBSERVE_SENSOR_PRIVACY";
    field public static final String OPEN_ACCESSIBILITY_DETAILS_SETTINGS = "android.permission.OPEN_ACCESSIBILITY_DETAILS_SETTINGS";
    field public static final String OVERRIDE_COMPAT_CHANGE_CONFIG_ON_RELEASE_BUILD = "android.permission.OVERRIDE_COMPAT_CHANGE_CONFIG_ON_RELEASE_BUILD";
    field @FlaggedApi("com.android.input.flags.override_key_behavior_permission_apis") public static final String OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW = "android.permission.OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW";
    field public static final String PACKAGE_VERIFICATION_AGENT = "android.permission.PACKAGE_VERIFICATION_AGENT";
    field public static final String PACKET_KEEPALIVE_OFFLOAD = "android.permission.PACKET_KEEPALIVE_OFFLOAD";
    field public static final String PEERS_MAC_ADDRESS = "android.permission.PEERS_MAC_ADDRESS";
+16 −0
Original line number Diff line number Diff line
@@ -7832,6 +7832,22 @@
    <permission android:name="android.permission.PREPARE_FACTORY_RESET"
        android:protectionLevel="signature|privileged" />

    <!-- @SystemApi Allows focused window to override the default behavior of supported system keys.
        The following keycodes are supported:
        <p> KEYCODE_STEM_PRIMARY
        <p>If an app is granted this permission and has a focused window, it will be allowed to
           receive supported key events that are otherwise handled by the system. The app can choose
           to consume the key events and trigger its own behavior, in which case the default key
           behavior will be skipped.
        <p>For example, KEYCODE_STEM_PRIMARY by default opens recent app launcher. If the foreground
           fitness app is granted this permission, it can repurpose the KEYCODE_STEM_PRIMARY button
           to pause/resume the current fitness session.
        <p>Protection level: signature|privileged
        @FlaggedApi("com.android.input.flags.override_key_behavior_permission_apis")
        @hide -->
    <permission android:name="android.permission.OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW"
        android:protectionLevel="signature|privileged" />

    <!-- Attribution for Geofencing service. -->
    <attribution android:tag="GeofencingService" android:label="@string/geofencing_service"/>
    <!-- Attribution for Country Detector. -->