summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortiger_huang <tiger_huang@htc.com>2014-10-14 14:48:00 +0800
committerTiger Huang <tiger_huang@htc.com>2014-11-25 12:29:37 +0000
commit1b33b497239d783ea25acd31764836818ebd65b5 (patch)
tree62b7c83ee12e7dc6e1a37fb6b9747e62762393df
parent71f83672f297b116988defbe989869e5744cda5e (diff)
downloadframeworks_base-1b33b497239d783ea25acd31764836818ebd65b5.zip
frameworks_base-1b33b497239d783ea25acd31764836818ebd65b5.tar.gz
frameworks_base-1b33b497239d783ea25acd31764836818ebd65b5.tar.bz2
Prevent showing immersive confirmation unexpectedly
By design, if the user presses the power key twice within 5 seconds (panic), it will show immersive confirmation again at the next time entering immersive mode. But there is a bug on calculating the time between pressing the power key. The time get from event.getDownTime() will stop when the device is sleeping without being charged. So here uses SystemClock.elapsedRealtime() instead. https://code.google.com/p/android/issues/detail?id=80772 Change-Id: I4dca9dc260904f1c5b60464834781e2a82a9bcf4
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java2
1 files changed, 1 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 2699d13..ccc700d 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -4389,7 +4389,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
result &= ~ACTION_PASS_TO_USER;
if (down) {
boolean panic = mImmersiveModeConfirmation.onPowerKeyDown(interactive,
- event.getDownTime(), isImmersiveMode(mLastSystemUiFlags));
+ SystemClock.elapsedRealtime(), isImmersiveMode(mLastSystemUiFlags));
if (panic) {
mHandler.post(mRequestTransientNav);
}