summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjtang <jtang@cyngn.com>2016-05-24 15:10:48 +0800
committerAdnan Begovic <adnan@cyngn.com>2016-05-24 09:52:27 -0700
commit82f64dcd8501f2b7b2d51a0375b6157240e540d2 (patch)
tree6c099c0f48a0404bdc7714729a6037d184786eff
parent112543548e41c9f58cdb5ba9b4f2a1f980555a88 (diff)
downloadframeworks_base-82f64dcd8501f2b7b2d51a0375b6157240e540d2.zip
frameworks_base-82f64dcd8501f2b7b2d51a0375b6157240e540d2.tar.gz
frameworks_base-82f64dcd8501f2b7b2d51a0375b6157240e540d2.tar.bz2
fw: Move HOME key interception logic to interceptKeyBeforeDispatching
TICKET: FEIJ-522 Change-Id: I290016413c6cad6f5c35f3ef2ee01779991eece8
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 339e269..1f9db49 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -3157,6 +3157,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// timeout.
if (keyCode == KeyEvent.KEYCODE_HOME) {
+ if (mTopFullscreenOpaqueWindowState != null &&
+ (mTopFullscreenOpaqueWindowState.getAttrs().privateFlags
+ & WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_SYSTEM_KEYS) != 0
+ && mScreenOnFully) {
+ return 0;
+ }
// If we have released the home key, and didn't do anything else
// while it was pressed, then it is time to go home!
if (!down) {
@@ -5767,13 +5773,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
case KeyEvent.KEYCODE_HOME:
- if (mTopFullscreenOpaqueWindowState != null &&
- (mTopFullscreenOpaqueWindowState.getAttrs().privateFlags
- & WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_SYSTEM_KEYS) != 0
- && mScreenOnFully) {
- return result;
- }
-
if (down && !interactive && mHomeWakeScreen) {
isWakeKey = true;
}