summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorBryce Lee <brycelee@google.com>2014-11-18 19:16:49 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-18 19:16:49 +0000
commite19872a983520f4be08fa0b909042f6282b4e417 (patch)
tree7242d1b1605cd6496183a018cec944d8a66afd78 /policy
parent7ff92f420e0f32149bcb80698db6108d9e5aaa53 (diff)
parentd4e55bdfc50635903e04934785ed82c39257506c (diff)
downloadframeworks_base-e19872a983520f4be08fa0b909042f6282b4e417.zip
frameworks_base-e19872a983520f4be08fa0b909042f6282b4e417.tar.gz
frameworks_base-e19872a983520f4be08fa0b909042f6282b4e417.tar.bz2
am d4e55bdf: am 8f7b84e0: Merge "Always wake device on power key from non interactive immediately." into lmp-sprout-dev
* commit 'd4e55bdfc50635903e04934785ed82c39257506c': Always wake device on power key from non interactive immediately.
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 6176839..93bdea6 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -319,6 +319,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// handler thread. We'll need to resolve this someday by teaching the input dispatcher
// to hold wakelocks during dispatch and eliminating the critical path.
volatile boolean mPowerKeyHandled;
+ volatile boolean mBeganFromNonInteractive;
volatile int mPowerKeyPressCounter;
volatile boolean mEndCallKeyHandled;
@@ -882,15 +883,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
}
} else {
- // When non-interactive, we ordinarily wake up immediately and
- // consume the key. However on some devices we need to support multi-press
- // without waking so we will delay handling for later in that case
- // (at the cost of increased latency).
+ wakeUpFromPowerKey(event.getDownTime());
final int maxCount = getMaxMultiPressPowerCount();
+
if (maxCount <= 1) {
- // No other actions. We can wake immediately.
- wakeUpFromPowerKey(event.getDownTime());
mPowerKeyHandled = true;
+ } else {
+ mBeganFromNonInteractive = true;
}
}
}
@@ -927,6 +926,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
private void finishPowerKeyPress() {
+ mBeganFromNonInteractive = false;
mPowerKeyPressCounter = 0;
if (mPowerKeyWakeLock.isHeld()) {
mPowerKeyWakeLock.release();
@@ -951,9 +951,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
powerMultiPressAction(eventTime, interactive, mDoublePressOnPowerBehavior);
} else if (count == 3) {
powerMultiPressAction(eventTime, interactive, mTriplePressOnPowerBehavior);
- } else if (!interactive) {
- wakeUpFromPowerKey(eventTime);
- } else {
+ } else if (interactive && !mBeganFromNonInteractive) {
switch (mShortPressOnPowerBehavior) {
case SHORT_PRESS_POWER_NOTHING:
break;