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

Commit 3a7e04a7 authored by Nick Chameyev's avatar Nick Chameyev
Browse files

Add logs for folding sleep behavior

Adding extra logs to investigate issues
when the devices doesn't go to sleep
unexpectedly after folding.

In b/374240152 the device didn't show the unlocked
keyguard after folding even though there were no
wakelocks present.

Flag: EXEMPT bugfix
Bug: 374240152
Test: manually verify log messages
Change-Id: I16a82546c068a35fbde3b74dcdac27c1ea9f5986
parent 9176f4a7
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -506,9 +506,6 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
            return;
        }

        Slog.i(TAG, "Requesting Transition to state: " + state.getIdentifier() + ", from state="
                + mDeviceState.getIdentifier() + ", interactive=" + mInteractive
                + ", mBootCompleted=" + mBootCompleted);
        // As part of a state transition, we may need to turn off some displays temporarily so that
        // the transition is smooth. Plus, on some devices, only one internal displays can be
        // on at a time. We use LogicalDisplay.setIsInTransition to mark a display that needs to be
@@ -522,6 +519,11 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
        final boolean sleepDevice = shouldDeviceBePutToSleep(mPendingDeviceState, mDeviceState,
                mInteractive, mBootCompleted);

        Slog.i(TAG, "Requesting Transition to state: " + state.getIdentifier() + ", from state="
                + mDeviceState.getIdentifier() + ", interactive=" + mInteractive
                + ", mBootCompleted=" + mBootCompleted + ", wakeDevice=" + wakeDevice
                + ", sleepDevice=" + sleepDevice);

        // If all displays are off already, we can just transition here, unless we are trying to
        // wake or sleep the device as part of this transition. In that case defer the final
        // transition until later once the device is awake/asleep.
+4 −0
Original line number Diff line number Diff line
@@ -7093,7 +7093,11 @@ public final class PowerManagerService extends SystemService
                    if ((flags & PowerManager.GO_TO_SLEEP_FLAG_SOFT_SLEEP) != 0) {
                        if (mFoldGracePeriodProvider.isEnabled()) {
                            if (!powerGroup.hasWakeLockKeepingScreenOnLocked()) {
                                Slog.d(TAG, "Showing dismissible keyguard");
                                mNotifier.showDismissibleKeyguard();
                            } else {
                                Slog.i(TAG, "There is a screen wake lock present: "
                                        + "sleep request will be ignored");
                            }
                            continue; // never actually goes to sleep for SOFT_SLEEP
                        } else {