Merge "Make MENU key work again to dismiss insecure Keyguard."
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -206,4 +206,8 @@ public class StatusBarKeyguardViewManager {
|
||||
mContainer.setSystemUiVisibility(vis | View.STATUS_BAR_DISABLE_BACK);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onMenuPressed() {
|
||||
return mBouncer.onMenuPressed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user