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
This commit is contained in:
Lucas Dupin
2020-01-06 09:27:48 -08:00
parent 18813f70ac
commit bcc606eae0
2 changed files with 3 additions and 9 deletions

View File

@@ -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;
}

View File

@@ -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()