From 337d9d2edc262141f9b8f684e53aae5e47f0ae13 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Tue, 22 Apr 2014 15:03:48 -0700 Subject: Move key attribute information into KeyEvent. This consolidates all of the information that was in the native KeyEvent and the KeyLayout files into the managed KeyEvent class. It also moves the definition for all of the key names to the native side, rather than having them in both places. Change-Id: I172e3b554e7eb52c79ae2ec406ef4332e8b25ffa --- .../com/android/internal/policy/impl/PhoneWindowManager.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'policy') diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 77e2462..8bc669a 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -3859,12 +3859,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { mKeyguardDelegate.isShowingAndNotOccluded() : mKeyguardDelegate.isShowing())); - if (keyCode == KeyEvent.KEYCODE_POWER - || keyCode == KeyEvent.KEYCODE_SLEEP - || keyCode == KeyEvent.KEYCODE_WAKEUP) { - policyFlags |= WindowManagerPolicy.FLAG_WAKE; - } - if (DEBUG_INPUT) { Log.d(TAG, "interceptKeyTq keycode=" + keyCode + " interactive=" + interactive + " keyguardActive=" + keyguardActive @@ -3878,8 +3872,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Basic policy based on interactive state. int result; - boolean isWakeKey = (policyFlags & (WindowManagerPolicy.FLAG_WAKE - | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0; + boolean isWakeKey = (policyFlags & WindowManagerPolicy.FLAG_WAKE) != 0 + || event.isWakeKey(); if (interactive || (isInjected && !isWakeKey)) { // When the screen is on or if the key is injected pass the key to the application. result = ACTION_PASS_TO_USER; -- cgit v1.1