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

Commit 28516eac authored by Chen Bai's avatar Chen Bai
Browse files

keyGesture: side key single press dismisses power menu

Currently, if the power(global action) menu is on top, the side key
press doesn't dismiss power menu while it still launches the Recents
menu in background. This is counter-intuitive for users.

The fix is that before Recents menu launch, dismiss the top power menu
first.

Note that the crown button only dismisses the power menu without launch
the all app menu since when power menu is on top, crown button works as
HOME button.

Bug: 436954641
Flag: EXEMPT. trival change
Test: Manual
Change-Id: I0befbc1fdcefeae5db2a4db9d0a3448eaf299945
parent 43426fbe
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -89,10 +89,10 @@ import static android.view.WindowManager.LayoutParams.isSystemAlertWindowType;
import static android.view.WindowManagerGlobal.ADD_OKAY;
import static android.view.WindowManagerGlobal.ADD_PERMISSION_DENIED;
import static android.view.contentprotection.flags.Flags.createAccessibilityOverlayAppOpEnabled;
import static com.android.internal.policy.IKeyguardService.SCREEN_TURNING_ON_REASON_UNKNOWN;
import static com.android.internal.policy.IKeyguardService.SCREEN_TURNING_ON_REASON_DISPLAY_SWITCH;

import static com.android.hardware.input.Flags.enableNew25q2Keycodes;
import static com.android.internal.policy.IKeyguardService.SCREEN_TURNING_ON_REASON_DISPLAY_SWITCH;
import static com.android.internal.policy.IKeyguardService.SCREEN_TURNING_ON_REASON_UNKNOWN;
import static com.android.server.policy.SingleKeyGestureEvent.ACTION_CANCEL;
import static com.android.server.policy.SingleKeyGestureEvent.ACTION_COMPLETE;
import static com.android.server.policy.SingleKeyGestureEvent.ACTION_START;
@@ -1602,6 +1602,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                allAppsIntent.addFlags(
                        Intent.FLAG_ACTIVITY_NEW_TASK
                                | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                sendCloseSystemWindows(SYSTEM_DIALOG_REASON_RECENT_APPS);
                startActivityAsUser(allAppsIntent, UserHandle.CURRENT_OR_SELF);
                break;
            case SHORT_PRESS_PRIMARY_LAUNCH_TARGET_ACTIVITY: