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

Commit 24bf9974 authored by Manu Cornet's avatar Manu Cornet
Browse files

Extract a protected method so that subclasses can share the logic

This is for the ability to dismiss the keyguard when pressing menu,
under certain circumstances.

Change-Id: If9f115c77d95284c8778e78b7d65da64c6b08254
parent bf720c18
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4041,9 +4041,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                && mStatusBarKeyguardViewManager.interceptMediaKey(event);
    }

    protected boolean shouldUnlockOnMenuPressed() {
        return mDeviceInteractive && mState != StatusBarState.SHADE
            && mStatusBarKeyguardViewManager.shouldDismissOnMenuPressed();
    }

    public boolean onMenuPressed() {
        if (mDeviceInteractive && mState != StatusBarState.SHADE
                && mStatusBarKeyguardViewManager.shouldDismissOnMenuPressed()) {
        if (shouldUnlockOnMenuPressed()) {
            animateCollapsePanels(
                    CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL /* flags */, true /* force */);
            return true;