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

Commit bcc606ea authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Fix doze log

We were logging from the wrong source of truth, before updating the
state. Now the value is read from a controller.

Test: adb shell dumpsys activity service com.android.systemui
Test: atest DozeServiceHostTest
Change-Id: I94c3815c78f9453454127e5286fc04f0aa219b73
parent 18813f70
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ public final class DozeServiceHost implements DozeHost {
    boolean mWakeLockScreenPerformsAuth = SystemProperties.getBoolean(
            "persist.sysui.wake_performs_auth", true);
    private boolean mDozingRequested;
    private boolean mDozing;
    private boolean mPulsing;
    private WakefulnessLifecycle mWakefulnessLifecycle;
    private final SysuiStatusBarStateController mStatusBarStateController;
@@ -196,8 +195,8 @@ public final class DozeServiceHost implements DozeHost {
    public void startDozing() {
        if (!mDozingRequested) {
            mDozingRequested = true;
            mDozeLog.traceDozing(mDozing);
            updateDozing();
            mDozeLog.traceDozing(mStatusBarStateController.isDozing());
            mStatusBar.updateIsKeyguard();
        }
    }
@@ -281,8 +280,8 @@ public final class DozeServiceHost implements DozeHost {
    public void stopDozing() {
        if (mDozingRequested) {
            mDozingRequested = false;
            mDozeLog.traceDozing(mDozing);
            updateDozing();
            mDozeLog.traceDozing(mStatusBarStateController.isDozing());
        }
    }

@@ -292,7 +291,7 @@ public final class DozeServiceHost implements DozeHost {
            mDozeLog.tracePulseTouchDisabledByProx(ignore);
        }
        mIgnoreTouchWhilePulsing = ignore;
        if (mDozing && ignore) {
        if (mStatusBarStateController.isDozing() && ignore) {
            mStatusBarWindowViewController.cancelCurrentTouch();
        }
    }
@@ -448,10 +447,6 @@ public final class DozeServiceHost implements DozeHost {
        return mAnimateScreenOff;
    }

    public void setDozing(boolean dozing) {
        mDozing = dozing;
    }

    boolean getIgnoreTouchWhilePulsing() {
        return mIgnoreTouchWhilePulsing;
    }
+0 −1
Original line number Diff line number Diff line
@@ -3491,7 +3491,6 @@ public class StatusBar extends SystemUI implements DemoMode,
    public void onDozingChanged(boolean isDozing) {
        Trace.beginSection("StatusBar#updateDozing");
        mDozing = isDozing;
        mDozeServiceHost.setDozing(mDozing);

        // Collapse the notification panel if open
        boolean dozingAnimated = mDozeServiceHost.getDozingRequested()