Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66b4c32f authored by Will Leshner's avatar Will Leshner
Browse files

Stop displaying "can't dream" debug message on every power button press.

The debug message is now behind a DEBUG_DREAMS compile-time constant
that defaults to false.

Bug: 430053930
Test: Manually by verifying debug message only displays if DEBUG_DREAMS
is true.
Flag: EXEMPT bugfix

Change-Id: Ic38137d53b42a748395270114f4091a377fdd7d8
parent 7f12e4ab
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -89,10 +89,10 @@ import static android.view.WindowManager.LayoutParams.isSystemAlertWindowType;
import static android.view.WindowManagerGlobal.ADD_OKAY;
import static android.view.WindowManagerGlobal.ADD_PERMISSION_DENIED;
import static android.view.contentprotection.flags.Flags.createAccessibilityOverlayAppOpEnabled;
import static com.android.internal.policy.IKeyguardService.SCREEN_TURNING_ON_REASON_UNKNOWN;
import static com.android.internal.policy.IKeyguardService.SCREEN_TURNING_ON_REASON_DISPLAY_SWITCH;

import static com.android.hardware.input.Flags.enableNew25q2Keycodes;
import static com.android.internal.policy.IKeyguardService.SCREEN_TURNING_ON_REASON_DISPLAY_SWITCH;
import static com.android.internal.policy.IKeyguardService.SCREEN_TURNING_ON_REASON_UNKNOWN;
import static com.android.server.policy.SingleKeyGestureEvent.ACTION_CANCEL;
import static com.android.server.policy.SingleKeyGestureEvent.ACTION_COMPLETE;
import static com.android.server.policy.SingleKeyGestureEvent.ACTION_START;
@@ -282,6 +282,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    static final boolean DEBUG_INPUT = false;
    static final boolean DEBUG_KEYGUARD = false;
    static final boolean DEBUG_WAKEUP = false;
    static final boolean DEBUG_DREAMS = false;

    // Whether to allow dock apps with METADATA_DOCK_HOME to temporarily take over the Home key.
    // No longer recommended for desk docks;
@@ -1295,10 +1296,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                dreamManagerInternal.stopDream(false /*immediate*/, "short press power" /*reason*/);
                return;
            }
            if (DEBUG_DREAMS) {
                Slog.d(TAG,
                    "Can't start dreaming and the device is not dreaming when attempting to start "
                    + "or stop dream from short power press (isScreenOn="
                        "Can't start dreaming and the device is not dreaming when attempting to "
                                + "start or stop dream from short power press (isScreenOn="
                                + isScreenOn + ", awakeWhenDream=" + awakeWhenDream + ")");
            }
            noDreamAction.run();
            return;
        }