Do not go to dream on power button press when screen is off.

This is essentially a revert of a previous change to start dreaming on
power button press when the device is docked and the screen is off. We
now just use the existing (default) behavior of turning on the device to
the lockscreen.

Bug: 265349281
Test: manually by docking device, turning the screen off, and then
tapping the power button to turn the screen back on. The device should
show the lockscreen and not attempt to start dreaming immediately.

Merged-In: I25bb8bc5b720fd6cc1b1ac9219c8c94eecf8232a
Change-Id: I5540ccd8c0f4d766aae8f3d9a13b11b257278d60
This commit is contained in:
Will Leshner
2023-01-12 15:30:51 -08:00
parent 87f4c66c0a
commit 12a548ad4b

View File

@@ -975,12 +975,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
powerMultiPressAction(eventTime, interactive, mTriplePressOnPowerBehavior);
} else if (count > 3 && count <= getMaxMultiPressPowerCount()) {
Slog.d(TAG, "No behavior defined for power press count " + count);
} else if (count == 1 && interactive) {
if (beganFromNonInteractive) {
// The screen off case, where we might want to start dreaming on power button press.
attemptToDreamFromShortPowerButtonPress(false, () -> {});
return;
}
} else if (count == 1 && interactive && !beganFromNonInteractive) {
if (mSideFpsEventHandler.shouldConsumeSinglePress(eventTime)) {
Slog.i(TAG, "Suppressing power key because the user is interacting with the "
+ "fingerprint sensor");