Merge "Power button press behavior should account for default display state" into sc-dev
This commit is contained in:
@@ -3409,8 +3409,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
return interceptKeyBeforeQueueing(event, policyFlags);
|
return interceptKeyBeforeQueueing(event, policyFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This could prevent some wrong state in multi-displays environment,
|
||||||
|
// the default display may turned off but interactive is true.
|
||||||
|
final boolean isDefaultDisplayOn = Display.isOnState(mDefaultDisplay.getState());
|
||||||
|
final boolean interactiveAndOn = interactive && isDefaultDisplayOn;
|
||||||
if ((event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
|
if ((event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
|
||||||
handleKeyGesture(event, interactive);
|
handleKeyGesture(event, interactiveAndOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable haptics if down and virtual key without multiple repetitions. If this is a hard
|
// Enable haptics if down and virtual key without multiple repetitions. If this is a hard
|
||||||
@@ -3557,8 +3561,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
// Any activity on the power button stops the accessibility shortcut
|
// Any activity on the power button stops the accessibility shortcut
|
||||||
result &= ~ACTION_PASS_TO_USER;
|
result &= ~ACTION_PASS_TO_USER;
|
||||||
isWakeKey = false; // wake-up will be handled separately
|
isWakeKey = false; // wake-up will be handled separately
|
||||||
final boolean isDefaultDisplayOn = Display.isOnState(mDefaultDisplay.getState());
|
|
||||||
final boolean interactiveAndOn = interactive && isDefaultDisplayOn;
|
|
||||||
if (down) {
|
if (down) {
|
||||||
interceptPowerKeyDown(event, interactiveAndOn);
|
interceptPowerKeyDown(event, interactiveAndOn);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user