From f37ffbacc096d97b051915d3547d963a443919d1 Mon Sep 17 00:00:00 2001 From: Will Leshner Date: Thu, 12 Jan 2023 15:30:51 -0800 Subject: [PATCH] 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 --- .../com/android/server/policy/PhoneWindowManager.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index b7a801a8fc867..b018c41f08501 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -988,14 +988,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 is 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");