diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2013-04-04 01:24:49 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2013-05-01 01:36:50 +0200 |
commit | 95f6c14009ee4bf43f92a8b07d2faab78a5033bd (patch) | |
tree | fbd534ff894bea1590545088465f9eb68330a469 /policy/src | |
parent | c926976008af16ab5e3a0bb532aeeb69565e3429 (diff) | |
download | frameworks_base-95f6c14009ee4bf43f92a8b07d2faab78a5033bd.zip frameworks_base-95f6c14009ee4bf43f92a8b07d2faab78a5033bd.tar.gz frameworks_base-95f6c14009ee4bf43f92a8b07d2faab78a5033bd.tar.bz2 |
DeviceKeyHandler: Increase handler priority
Allow DeviceKeyHandler to have higher priority when handling user keystrokes.
Patchset 2: Update commit message
Patchset 3: Rebased
Patchset 4: Fixed needed ref
Patchset 5: Rebased
Needed by http://review.cyanogenmod.org/#/c/35064
Change-Id: I60871052aaae0af7d864113f00dbdf9ba5200f2e
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'policy/src')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 187c6df..2a97b33 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -2218,6 +2218,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { mHandler.removeCallbacks(mBackLongPress); } + // Specific device key handling + if (mDeviceKeyHandler != null) { + try { + // The device only should consume known keys. + if (mDeviceKeyHandler.handleKeyEvent(event)) { + return -1; + } + } catch (Exception e) { + Slog.w(TAG, "Could not dispatch event to device key handler", e); + } + } + // First we always handle the home key here, so applications // can never break it, although if keyguard is on, we do let // it handle it, because that gives us the correct 5 second @@ -2550,18 +2562,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { return -1; } - // Specific device key handling - if (mDeviceKeyHandler != null) { - try { - // The device only should consume known keys. - if (mDeviceKeyHandler.handleKeyEvent(event)) { - return -1; - } - } catch (Exception e) { - Slog.w(TAG, "Could not dispatch event to device key handler", e); - } - } - // Let the application handle the key. return 0; } |