summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-10-07 16:42:28 -0700
committerJeff Brown <jeffbrown@google.com>2014-10-07 16:47:25 -0700
commit734ab8e60b6a7df936955ceffae3ef75ec09825e (patch)
treef5b81e409adf6b4e1088ea6aecab71a5523d1640 /policy
parent99586dc0108d0f4311c8af4d06ed113bbf40a6ee (diff)
downloadframeworks_base-734ab8e60b6a7df936955ceffae3ef75ec09825e.zip
frameworks_base-734ab8e60b6a7df936955ceffae3ef75ec09825e.tar.gz
frameworks_base-734ab8e60b6a7df936955ceffae3ef75ec09825e.tar.bz2
Suppress redundant power key presses while turning screen on.
Sometimes it can take a long time to turn the screen on. That's not good but what's worse is that the user will often get impatient and press the power button again which effectively cancels the process and makes the screen not come on at all. The user may then conclude that the device ignored the power key press. This change suppresses power key presses while we're already in the process of turning the screen on so that at least the screen comes on eventually, even if it's slower than we would like. Bug: 17753363 Change-Id: I23083873e35a3dcfa5c20b6f870f53c18e465582
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index f7ed364..99d5848 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -4421,7 +4421,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mPowerKeyTriggered = false;
cancelPendingScreenshotChordAction();
if (interceptPowerKeyUp(canceled || mPendingPowerKeyUpCanceled)) {
- powerShortPress(event.getEventTime());
+ if (mScreenOnEarly && !mScreenOnFully) {
+ Slog.i(TAG, "Suppressed redundant power key press while "
+ + "already in the process of turning the screen on.");
+ } else {
+ powerShortPress(event.getEventTime());
+ }
isWakeKey = false;
}
mPendingPowerKeyUpCanceled = false;