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

Commit 1902cd34 authored by Beverly's avatar Beverly
Browse files

Add logs for whether doze is suppressed

Dozing can be suppressed by the PowerManager. Log when doze is
suppressed this way so it's easier to debug when users no longer see AOD
when they expect AOD.

Test: manual
Change-Id: I4c2b2d322cb8b6af5d18bed73f32b3d7f5b0b4c1
parent 687d46aa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -122,6 +122,14 @@ public class DozeLog implements Dumpable {
        mPulsing = false;
    }

    /**
     * Appends dozing event to the logs
     * @param suppressed true if dozing is suppressed
     */
    public void traceDozingSuppressed(boolean suppressed) {
        mLogger.logDozingSuppressed(suppressed);
    }

    /**
     * Appends fling event to the logs
     */
+8 −0
Original line number Diff line number Diff line
@@ -64,6 +64,14 @@ class DozeLogger @Inject constructor(
        })
    }

    fun logDozingSuppressed(isDozingSuppressed: Boolean) {
        buffer.log(TAG, INFO, {
            bool1 = isDozingSuppressed
        }, {
            "DozingSuppressed=$bool1"
        })
    }

    fun logFling(
        expand: Boolean,
        aboveThreshold: Boolean,
+1 −0
Original line number Diff line number Diff line
@@ -413,6 +413,7 @@ public class DozeMachine {
        pw.print(" state="); pw.println(mState);
        pw.print(" wakeLockHeldForCurrentState="); pw.println(mWakeLockHeldForCurrentState);
        pw.print(" wakeLock="); pw.println(mWakeLock);
        pw.print(" isDozeSuppressed="); pw.println(mDozeHost.isDozeSuppressed());
        pw.println("Parts:");
        for (Part p : mParts) {
            p.dump(pw);
+1 −0
Original line number Diff line number Diff line
@@ -456,6 +456,7 @@ public final class DozeServiceHost implements DozeHost {
            return;
        }
        mSuppressed = suppressed;
        mDozeLog.traceDozingSuppressed(mSuppressed);
        for (Callback callback : mCallbacks) {
            callback.onDozeSuppressedChanged(suppressed);
        }