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

Commit 7189ed39 authored by Philip Junker's avatar Philip Junker
Browse files

Add more dream logs

Bug: 295883390
Test: None
Change-Id: I1405562f253475410da2aff025cd69743c7c5db1
parent 605810e1
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -3347,6 +3347,8 @@ public final class PowerManagerService extends SystemService
            } else {
                startDreaming = false;
            }
            Slog.i(TAG, "handleSandman powerGroup=" + groupId + " startDreaming=" + startDreaming
                    + " wakefulness=" + wakefulnessToString(wakefulness));
        }

        // Start dreaming if needed.
@@ -3381,19 +3383,23 @@ public final class PowerManagerService extends SystemService
            if (startDreaming && isDreaming) {
                mDreamsBatteryLevelDrain = 0;
                if (wakefulness == WAKEFULNESS_DOZING) {
                    Slog.i(TAG, "Dozing...");
                    Slog.i(TAG, "Dozing powerGroup " + groupId);
                } else {
                    Slog.i(TAG, "Dreaming...");
                    Slog.i(TAG, "Dreaming powerGroup " + groupId);
                }
            }

            // If preconditions changed, wait for the next iteration to determine
            // whether the dream should continue (or be restarted).
            final PowerGroup powerGroup = mPowerGroups.get(groupId);
            final int newWakefulness = powerGroup.getWakefulnessLocked();
            if (powerGroup.isSandmanSummonedLocked()
                    || powerGroup.getWakefulnessLocked() != wakefulness) {
                    || newWakefulness != wakefulness) {
                return; // wait for next cycle
            }
            Slog.i(TAG, "handleSandman powerGroup=" + groupId + " isDreaming=" + isDreaming
                    + " wakefulness=" + newWakefulness);


            // Determine whether the dream should continue.
            long now = mClock.uptimeMillis();