diff options
Diffstat (limited to 'packages')
4 files changed, 31 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index 71d1862..f2054a2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -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; + } + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 679b81b..d371d33 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -2855,6 +2855,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { } } + public boolean onMenuPressed() { + return mOnKeyguard && mStatusBarKeyguardViewManager.onMenuPressed(); + } + public boolean onBackPressed() { if (mOnKeyguard) { return mStatusBarKeyguardViewManager.onBackPressed(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index f666773..41b5b7c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -206,4 +206,8 @@ public class StatusBarKeyguardViewManager { mContainer.setSystemUiVisibility(vis | View.STATUS_BAR_DISABLE_BACK); } } + + public boolean onMenuPressed() { + return mBouncer.onMenuPressed(); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index dd89f47..1d675bd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -77,11 +77,15 @@ public class StatusBarWindowView extends FrameLayout public boolean dispatchKeyEvent(KeyEvent event) { boolean down = event.getAction() == KeyEvent.ACTION_DOWN; switch (event.getKeyCode()) { - case KeyEvent.KEYCODE_BACK: - if (!down) { - mService.onBackPressed(); - } - return true; + case KeyEvent.KEYCODE_BACK: + if (!down) { + mService.onBackPressed(); + } + return true; + case KeyEvent.KEYCODE_MENU: + if (!down) { + return mService.onMenuPressed(); + } } return super.dispatchKeyEvent(event); } |