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.

Change-Id: I25bb8bc5b720fd6cc1b1ac9219c8c94eecf8232a
This commit is contained in:
Will Leshner
2023-01-12 15:30:51 -08:00
parent 7be84b8a56
commit f37ffbacc0

View File

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