commit | e731a4ed3a0c7fa4d1e151f029a18c26091bceb1 | [log] [tgz] |
---|---|---|
author | Jorim Jaggi <jjaggi@google.com> | Wed Apr 16 21:55:55 2014 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Wed Apr 16 21:55:56 2014 +0000 |
tree | 6f9fe86d80116a818f6e734b21b011e036847a6f | |
parent | e0fa592afc163708d7707158ff76ee8148d90e79 [diff] | |
parent | 8c8bcc160aba9a5e93c8df2a99a39a856fafffab [diff] |
Merge "Make MENU key work again to dismiss insecure Keyguard."
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 @@ } 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 04b0fc6..5f71516 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -2976,6 +2976,10 @@ } } + 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 @@ 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 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); }