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

Commit e731a4ed authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Make MENU key work again to dismiss insecure Keyguard."

parents e0fa592a 8c8bcc16
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -142,4 +142,18 @@ public class KeyguardBouncer {
        }
        return false;
    }

    public boolean onMenuPressed() {
        ensureView();
        if (mKeyguardView.handleMenuKey()) {

            // We need to show it in case it is secure. If not, it will get dismissed in any case.
            mRoot.setVisibility(View.VISIBLE);
            mKeyguardView.requestFocus();
            mKeyguardView.onResume();
            return true;
        } else {
            return false;
        }
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -2976,6 +2976,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
        }
    }

    public boolean onMenuPressed() {
        return mOnKeyguard && mStatusBarKeyguardViewManager.onMenuPressed();
    }

    public boolean onBackPressed() {
        if (mOnKeyguard) {
            return mStatusBarKeyguardViewManager.onBackPressed();
+4 −0
Original line number Diff line number Diff line
@@ -206,4 +206,8 @@ public class StatusBarKeyguardViewManager {
            mContainer.setSystemUiVisibility(vis | View.STATUS_BAR_DISABLE_BACK);
        }
    }

    public boolean onMenuPressed() {
        return mBouncer.onMenuPressed();
    }
}
+9 −5
Original line number Diff line number Diff line
@@ -82,6 +82,10 @@ public class StatusBarWindowView extends FrameLayout
                    mService.onBackPressed();
                }
                return true;
            case KeyEvent.KEYCODE_MENU:
                if (!down) {
                    return mService.onMenuPressed();
                }
        }
        return super.dispatchKeyEvent(event);
    }