summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-02-20 18:05:03 -0800
committerJeff Brown <jeffbrown@google.com>2014-02-20 18:05:03 -0800
commit10102e4c0e501333a12b38a5cfe709d1558d84dd (patch)
tree6b4b3b43c1e55d3812664a8530d7d72f633d596d /policy
parent1a405db22a2ade6b745f3e1cf93ba0c54b048d95 (diff)
parentbaaa080b625f2448758d87dadc2706d0e2335a86 (diff)
downloadframeworks_base-10102e4c0e501333a12b38a5cfe709d1558d84dd.zip
frameworks_base-10102e4c0e501333a12b38a5cfe709d1558d84dd.tar.gz
frameworks_base-10102e4c0e501333a12b38a5cfe709d1558d84dd.tar.bz2
resolved conflicts for merge of baaa080b to master
Change-Id: I3ee12321e298f7a2ea577a99f30c49f3bb497fae
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index ada649d..7886f5d 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -3799,14 +3799,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (keyCode == KeyEvent.KEYCODE_POWER) {
policyFlags |= WindowManagerPolicy.FLAG_WAKE;
}
- final boolean isWakeKey = (policyFlags & (WindowManagerPolicy.FLAG_WAKE
- | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
if (DEBUG_INPUT) {
Log.d(TAG, "interceptKeyTq keycode=" + keyCode
+ " screenIsOn=" + isScreenOn + " keyguardActive=" + keyguardActive
- + " policyFlags=" + Integer.toHexString(policyFlags)
- + " isWakeKey=" + isWakeKey);
+ + " policyFlags=" + Integer.toHexString(policyFlags));
}
if (down && (policyFlags & WindowManagerPolicy.FLAG_VIRTUAL) != 0
@@ -3823,6 +3820,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// the device some other way (which is why we have an exemption here for injected
// events).
int result;
+ boolean isWakeKey = (policyFlags & (WindowManagerPolicy.FLAG_WAKE
+ | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
if (isScreenOn || (isInjected && !isWakeKey)) {
// When the screen is on or if the key is injected pass the key to the application.
result = ACTION_PASS_TO_USER;
@@ -3830,8 +3829,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// When the screen is off and the key is not injected, determine whether
// to wake the device but don't pass the key to the application.
result = 0;
- if (down && isWakeKey && isWakeKeyWhenScreenOff(keyCode)) {
- result |= ACTION_WAKE_UP;
+ if (isWakeKey && (!down || !isWakeKeyWhenScreenOff(keyCode))) {
+ isWakeKey = false;
}
}
@@ -3941,7 +3940,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
if ((mEndcallBehavior
& Settings.System.END_BUTTON_BEHAVIOR_SLEEP) != 0) {
- result = (result & ~ACTION_WAKE_UP) | ACTION_GO_TO_SLEEP;
+ mPowerManager.goToSleep(event.getEventTime());
+ isWakeKey = false;
}
}
}
@@ -3988,7 +3988,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mPowerKeyTriggered = false;
cancelPendingScreenshotChordAction();
if (interceptPowerKeyUp(canceled || mPendingPowerKeyUpCanceled)) {
- result = (result & ~ACTION_WAKE_UP) | ACTION_GO_TO_SLEEP;
+ mPowerManager.goToSleep(event.getEventTime());
+ isWakeKey = false;
}
mPendingPowerKeyUpCanceled = false;
}
@@ -4058,6 +4059,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
break;
}
}
+
+ if (isWakeKey) {
+ mPowerManager.wakeUp(event.getEventTime());
+ }
return result;
}
@@ -4098,13 +4103,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
@Override
- public int interceptMotionBeforeQueueingWhenScreenOff(int policyFlags) {
+ public int interceptMotionBeforeQueueingWhenScreenOff(long whenNanos, int policyFlags) {
int result = 0;
final boolean isWakeMotion = (policyFlags
& (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
if (isWakeMotion) {
- result |= ACTION_WAKE_UP;
+ mPowerManager.wakeUp(whenNanos / 1000000);
}
return result;
}