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

Commit 74614b10 authored by Steven Ng's avatar Steven Ng
Browse files

Use grantManageKeyGesturesToRecents flag for granting recents key gesture events

Reason: Recents app can only listen to key gesture events after ag/33295605, which is gated by a read only flag, com.android.window.flags.grant_manage_key_gestures_to_recents.

Test: atest WmTests:PhoneWindowManagerTests
Flag: com.android.window.flags.grant_manage_key_gestures_to_recents
Bug: 406452076
Change-Id: Ife54c640e73ca68b016d0d7279184a61167df5bc
parent b7bf86b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3407,8 +3407,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (enableTalkbackAndMagnifierKeyGestures()) {
            supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_TALKBACK);
        }
        if (!com.android.window.flags.Flags.enableKeyGestureHandlerForRecents()) {
            // When enableKeyGestureHandlerForRecents is enabled, the event is handled in the
        if (!com.android.window.flags.Flags.grantManageKeyGesturesToRecents()) {
            // When grantManageKeyGesturesToRecents is enabled, the event is handled in the
            // recents app.
            supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS);
            supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_RECENT_APPS);
+2 −2
Original line number Diff line number Diff line
@@ -433,7 +433,7 @@ public class PhoneWindowManagerTests {
    }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_KEY_GESTURE_HANDLER_FOR_RECENTS)
    @EnableFlags(Flags.FLAG_GRANT_MANAGE_KEY_GESTURES_TO_RECENTS)
    public void testKeyGestureEvents_recentKeyGesturesEventsEnabled_notRegistered() {
        initPhoneWindowManager();

@@ -448,7 +448,7 @@ public class PhoneWindowManagerTests {
    }

    @Test
    @DisableFlags(Flags.FLAG_ENABLE_KEY_GESTURE_HANDLER_FOR_RECENTS)
    @DisableFlags(Flags.FLAG_GRANT_MANAGE_KEY_GESTURES_TO_RECENTS)
    public void testKeyGestureEvents_recentKeyGesturesEventsDisabled_registered() {
        initPhoneWindowManager();