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
This commit is contained in:
Jeff Brown
2014-10-07 16:42:28 -07:00
parent 99586dc010
commit 734ab8e60b

View File

@@ -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;