summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/WindowManagerPolicy.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-10-29 21:50:21 -0700
committerJeff Brown <jeffbrown@google.com>2010-12-22 16:00:21 -0800
commiteb9f7a01b0f501a535d872a957c1102ebb13d1c7 (patch)
tree44df101d8d798a84649dd5a4c9d2d32ab6bc7284 /core/java/android/view/WindowManagerPolicy.java
parent2bf89b2197674ccc414ea60a61199562df9dc52b (diff)
downloadframeworks_base-eb9f7a01b0f501a535d872a957c1102ebb13d1c7.zip
frameworks_base-eb9f7a01b0f501a535d872a957c1102ebb13d1c7.tar.gz
frameworks_base-eb9f7a01b0f501a535d872a957c1102ebb13d1c7.tar.bz2
Fix policy issues when screen is off. (DO NOT MERGE)
Rewrote interceptKeyBeforeQueueing to make the handling more systematic. Behavior should be identical except: - We never pass keys to applications when the screen is off and the keyguard is not showing (the proximity sensor turned off the screen). Previously we passed all non-wake keys through in this case which caused a bug on Crespo where the screen would come back on if a soft key was held at the time of power off because the resulting key up event would sneak in just before the keyguard was shown. It would then be passed through to the dispatcher which would poke user activity and wake up the screen. - We propagate the key flags when broadcasting media keys which ensures that recipients can tell when the key is canceled. - We ignore endcall or power if canceled (shouldn't happen anyways). Changed the input dispatcher to not poke user activity for canceled events since they are synthetic and should not wake the device. Changed the lock screen so that it does not poke the wake lock when the grab handle is released. This fixes a bug where the screen would come back on immediately if the power went off while the user was holding one of the grab handles because the sliding tab would receive an up event after screen turned off and release the grab handles. Bug: 3144874 Change-Id: Iebb91e10592b4ef2de4b1dd3a2e1e4254aacb697
Diffstat (limited to 'core/java/android/view/WindowManagerPolicy.java')
-rw-r--r--core/java/android/view/WindowManagerPolicy.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index 1fd31a3..1a341e1 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -544,16 +544,18 @@ public interface WindowManagerPolicy {
* Generally, it's best to keep as little as possible in the queue thread
* because it's the most fragile.
* @param whenNanos The event time in uptime nanoseconds.
+ * @param action The key event action.
+ * @param flags The key event flags.
* @param keyCode The key code.
- * @param down True if the key is down.
+ * @param scanCode The key's scan code.
* @param policyFlags The policy flags associated with the key.
* @param isScreenOn True if the screen is already on
*
* @return The bitwise or of the {@link #ACTION_PASS_TO_USER},
* {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags.
*/
- public int interceptKeyBeforeQueueing(long whenNanos, int keyCode, boolean down, int policyFlags,
- boolean isScreenOn);
+ public int interceptKeyBeforeQueueing(long whenNanos, int action, int flags,
+ int keyCode, int scanCode, int policyFlags, boolean isScreenOn);
/**
* Called from the input dispatcher thread before a key is dispatched to a window.
@@ -571,6 +573,7 @@ public interface WindowManagerPolicy {
* @param action The key event action.
* @param flags The key event flags.
* @param keyCode The key code.
+ * @param scanCode The key's scan code.
* @param metaState bit mask of meta keys that are held.
* @param repeatCount Number of times a key down has repeated.
* @param policyFlags The policy flags associated with the key.
@@ -578,7 +581,7 @@ public interface WindowManagerPolicy {
* not be further dispatched.
*/
public boolean interceptKeyBeforeDispatching(WindowState win, int action, int flags,
- int keyCode, int metaState, int repeatCount, int policyFlags);
+ int keyCode, int scanCode, int metaState, int repeatCount, int policyFlags);
/**
* Called when layout of the windows is about to start.