diff options
author | Jim Miller <jaggies@google.com> | 2012-12-05 15:15:00 -0800 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2012-12-05 15:15:00 -0800 |
commit | 42df15e93d3eb70846270b26c024f1575e82fa06 (patch) | |
tree | 6b7e78684ef06bc3578bacd73e6ddba5c8f3dd2e /policy | |
parent | 7b0855715bc6cb14e3ca67d815915d2172f0bc12 (diff) | |
download | frameworks_base-42df15e93d3eb70846270b26c024f1575e82fa06.zip frameworks_base-42df15e93d3eb70846270b26c024f1575e82fa06.tar.gz frameworks_base-42df15e93d3eb70846270b26c024f1575e82fa06.tar.bz2 |
Fix password field focus in keyguard
This fixes a bug introduced in Change-Id: I34b7db402401a824f463d35d7546c05dc2979243 where
the top-most view was allowed to capture focus in order to ensure the device handled volume
key events.
This resolves the issue by restoring previous behavior and ensures we still handle media keys,
regardless of focus.
Fixes bug 7676996
Change-Id: Id2d1200be81640e4b4b7b5e3a0af099d6fc2d259
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java | 5 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java | 17 |
2 files changed, 12 insertions, 10 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index 801b627..f1bc0f6 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -288,11 +288,6 @@ public class KeyguardHostView extends KeyguardViewBase { showPrimarySecurityScreen(false); updateSecurityViews(); - - // Make sure at least this view is focusable in case nothing below it is. Otherwise, - // requestFocus() on this view will fail and allow events, such as volume keys, to be - // handled by the fallback handler. See bug 7546960 for details. - setFocusableInTouchMode(true); } private boolean shouldEnableAddWidget() { diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java index dac852a..b6cf4da 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java @@ -153,11 +153,18 @@ public class KeyguardViewManager { @Override public boolean dispatchKeyEvent(KeyEvent event) { - if (event.getAction() == KeyEvent.ACTION_DOWN && mKeyguardView != null) { - int keyCode = event.getKeyCode(); - if (keyCode == KeyEvent.KEYCODE_BACK && mKeyguardView.handleBackKey()) { - return true; - } else if (keyCode == KeyEvent.KEYCODE_MENU && mKeyguardView.handleMenuKey()) { + if (mKeyguardView != null) { + // Always process back and menu keys, regardless of focus + if (event.getAction() == KeyEvent.ACTION_DOWN) { + int keyCode = event.getKeyCode(); + if (keyCode == KeyEvent.KEYCODE_BACK && mKeyguardView.handleBackKey()) { + return true; + } else if (keyCode == KeyEvent.KEYCODE_MENU && mKeyguardView.handleMenuKey()) { + return true; + } + } + // Always process media keys, regardless of focus + if (mKeyguardView.dispatchKeyEvent(event)) { return true; } } |