diff options
author | Bryce Lee <brycelee@google.com> | 2014-11-17 17:40:59 -0800 |
---|---|---|
committer | Bryce Lee <brycelee@google.com> | 2014-11-17 17:40:59 -0800 |
commit | d9268e3f012b0c98cf27cff2aa2a0b774fb59603 (patch) | |
tree | adb2fa61fdb3b6af6d2ddb6692d22a152fa1804c /policy/src | |
parent | fb26a2c80b988118983251caf36492f2ae39559c (diff) | |
download | frameworks_base-d9268e3f012b0c98cf27cff2aa2a0b774fb59603.zip frameworks_base-d9268e3f012b0c98cf27cff2aa2a0b774fb59603.tar.gz frameworks_base-d9268e3f012b0c98cf27cff2aa2a0b774fb59603.tar.bz2 |
Always wake device on power key from non interactive immediately.
Bug: 18410573
Change-Id: Ic5ec4a1ac6d5e06fed8eb0c5cc6b2741e03b7f53
Diffstat (limited to 'policy/src')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 16 |
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 627d1d5..54fb89d 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -316,6 +316,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; @@ -877,15 +878,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; } } } @@ -922,6 +921,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } private void finishPowerKeyPress() { + mBeganFromNonInteractive = false; mPowerKeyPressCounter = 0; if (mPowerKeyWakeLock.isHeld()) { mPowerKeyWakeLock.release(); @@ -946,9 +946,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; |