Loading packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +12 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,18 @@ public interface DozeHost { boolean isPulsingBlocked(); boolean isProvisioned(); /** * Whether there's a pulse that's been requested but hasn't started transitioning to pulsing * states yet. */ boolean isPulsePending(); /** * @param isPulsePending whether a pulse has been requested but hasn't started transitioning * to the pulse state yet */ void setPulsePending(boolean isPulsePending); /** * Makes a current pulse last for twice as long. * @param reason why we're extending it. Loading packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +9 −2 Original line number Diff line number Diff line Loading @@ -280,8 +280,8 @@ public class DozeLog implements Dumpable { /** * Appends pulse dropped event to logs */ public void tracePulseDropped(boolean pulsePending, DozeMachine.State state, boolean blocked) { mLogger.logPulseDropped(pulsePending, state, blocked); public void tracePulseDropped(String from, DozeMachine.State state) { mLogger.logPulseDropped(from, state); } /** Loading @@ -291,6 +291,13 @@ public class DozeLog implements Dumpable { mLogger.logSensorEventDropped(sensorEvent, reason); } /** * Appends pulsing event to logs. */ public void tracePulseEvent(String pulseEvent, boolean dozing, int pulseReason) { mLogger.logPulseEvent(pulseEvent, dozing, DozeLog.reasonToString(pulseReason)); } /** * Appends pulse dropped event to logs * @param reason why the pulse was dropped Loading packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt +14 −5 Original line number Diff line number Diff line Loading @@ -224,13 +224,12 @@ class DozeLogger @Inject constructor( }) } fun logPulseDropped(pulsePending: Boolean, state: DozeMachine.State, blocked: Boolean) { fun logPulseDropped(from: String, state: DozeMachine.State) { buffer.log(TAG, INFO, { bool1 = pulsePending str1 = state.name bool2 = blocked str1 = from str2 = state.name }, { "Pulse dropped, pulsePending=$bool1 state=$str1 blocked=$bool2" "Pulse dropped, cannot pulse from=$str1 state=$str2" }) } Loading @@ -243,6 +242,16 @@ class DozeLogger @Inject constructor( }) } fun logPulseEvent(pulseEvent: String, dozing: Boolean, pulseReason: String) { buffer.log(TAG, DEBUG, { str1 = pulseEvent bool1 = dozing str2 = pulseReason }, { "Pulse-$str1 dozing=$bool1 pulseReason=$str2" }) } fun logPulseDropped(reason: String) { buffer.log(TAG, INFO, { str1 = reason Loading packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +34 −25 Original line number Diff line number Diff line Loading @@ -102,7 +102,6 @@ public class DozeTriggers implements DozeMachine.Part { private final UiEventLogger mUiEventLogger; private long mNotificationPulseTime; private boolean mPulsePending; private Runnable mAodInterruptRunnable; /** see {@link #onProximityFar} prox for callback */ Loading Loading @@ -303,8 +302,8 @@ public class DozeTriggers implements DozeMachine.Part { null /* onPulseSuppressedListener */); } } else { proximityCheckThenCall((result) -> { if (result != null && result) { proximityCheckThenCall((isNear) -> { if (isNear != null && isNear) { // In pocket, drop event. mDozeLog.traceSensorEventDropped(pulseReason, "prox reporting near"); return; Loading Loading @@ -410,8 +409,8 @@ public class DozeTriggers implements DozeMachine.Part { sWakeDisplaySensorState = wake; if (wake) { proximityCheckThenCall((result) -> { if (result != null && result) { proximityCheckThenCall((isNear) -> { if (isNear != null && isNear) { // In pocket, drop event. return; } Loading Loading @@ -537,24 +536,44 @@ public class DozeTriggers implements DozeMachine.Part { return; } if (mPulsePending || !mAllowPulseTriggers || !canPulse()) { if (mAllowPulseTriggers) { mDozeLog.tracePulseDropped(mPulsePending, dozeState, mDozeHost.isPulsingBlocked()); if (!mAllowPulseTriggers || mDozeHost.isPulsePending() || !canPulse()) { if (!mAllowPulseTriggers) { mDozeLog.tracePulseDropped("requestPulse - !mAllowPulseTriggers"); } else if (mDozeHost.isPulsePending()) { mDozeLog.tracePulseDropped("requestPulse - pulsePending"); } else if (!canPulse()) { mDozeLog.tracePulseDropped("requestPulse", dozeState); } runIfNotNull(onPulseSuppressedListener); return; } mPulsePending = true; proximityCheckThenCall((result) -> { if (result != null && result) { mDozeHost.setPulsePending(true); proximityCheckThenCall((isNear) -> { if (isNear != null && isNear) { // in pocket, abort pulse mDozeLog.tracePulseDropped("inPocket"); mPulsePending = false; mDozeLog.tracePulseDropped("requestPulse - inPocket"); mDozeHost.setPulsePending(false); runIfNotNull(onPulseSuppressedListener); } else { // not in pocket, continue pulsing continuePulseRequest(reason); final boolean isPulsePending = mDozeHost.isPulsePending(); mDozeHost.setPulsePending(false); if (!isPulsePending || mDozeHost.isPulsingBlocked() || !canPulse()) { if (!isPulsePending) { mDozeLog.tracePulseDropped("continuePulseRequest - pulse no longer" + " pending, pulse was cancelled before it could start" + " transitioning to pulsing state."); } else if (mDozeHost.isPulsingBlocked()) { mDozeLog.tracePulseDropped("continuePulseRequest - pulsingBlocked"); } else if (!canPulse()) { mDozeLog.tracePulseDropped("continuePulseRequest", mMachine.getState()); } runIfNotNull(onPulseSuppressedListener); return; } mMachine.requestPulse(reason); } }, !mDozeParameters.getProxCheckBeforePulse() || performedProxCheck, reason); Loading @@ -569,16 +588,6 @@ public class DozeTriggers implements DozeMachine.Part { || mMachine.getState() == DozeMachine.State.DOZE_AOD_DOCKED; } private void continuePulseRequest(int reason) { mPulsePending = false; if (mDozeHost.isPulsingBlocked() || !canPulse()) { mDozeLog.tracePulseDropped(mPulsePending, mMachine.getState(), mDozeHost.isPulsingBlocked()); return; } mMachine.requestPulse(reason); } @Nullable private InstanceId getKeyguardSessionId() { return mSessionTracker.getSessionId(SESSION_KEYGUARD); Loading @@ -591,7 +600,7 @@ public class DozeTriggers implements DozeMachine.Part { pw.print(" notificationPulseTime="); pw.println(Formatter.formatShortElapsedTime(mContext, mNotificationPulseTime)); pw.println(" pulsePending=" + mPulsePending); pw.println(" DozeHost#isPulsePending=" + mDozeHost.isPulsePending()); pw.println("DozeSensors:"); IndentingPrintWriter idpw = new IndentingPrintWriter(pw); idpw.increaseIndent(); Loading packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ public class LogModule { @SysUISingleton @DozeLog public static LogBuffer provideDozeLogBuffer(LogBufferFactory factory) { return factory.create("DozeLog", 100); return factory.create("DozeLog", 120); } /** Provides a logging buffer for all logs related to the data layer of notifications. */ Loading Loading
packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +12 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,18 @@ public interface DozeHost { boolean isPulsingBlocked(); boolean isProvisioned(); /** * Whether there's a pulse that's been requested but hasn't started transitioning to pulsing * states yet. */ boolean isPulsePending(); /** * @param isPulsePending whether a pulse has been requested but hasn't started transitioning * to the pulse state yet */ void setPulsePending(boolean isPulsePending); /** * Makes a current pulse last for twice as long. * @param reason why we're extending it. Loading
packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +9 −2 Original line number Diff line number Diff line Loading @@ -280,8 +280,8 @@ public class DozeLog implements Dumpable { /** * Appends pulse dropped event to logs */ public void tracePulseDropped(boolean pulsePending, DozeMachine.State state, boolean blocked) { mLogger.logPulseDropped(pulsePending, state, blocked); public void tracePulseDropped(String from, DozeMachine.State state) { mLogger.logPulseDropped(from, state); } /** Loading @@ -291,6 +291,13 @@ public class DozeLog implements Dumpable { mLogger.logSensorEventDropped(sensorEvent, reason); } /** * Appends pulsing event to logs. */ public void tracePulseEvent(String pulseEvent, boolean dozing, int pulseReason) { mLogger.logPulseEvent(pulseEvent, dozing, DozeLog.reasonToString(pulseReason)); } /** * Appends pulse dropped event to logs * @param reason why the pulse was dropped Loading
packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt +14 −5 Original line number Diff line number Diff line Loading @@ -224,13 +224,12 @@ class DozeLogger @Inject constructor( }) } fun logPulseDropped(pulsePending: Boolean, state: DozeMachine.State, blocked: Boolean) { fun logPulseDropped(from: String, state: DozeMachine.State) { buffer.log(TAG, INFO, { bool1 = pulsePending str1 = state.name bool2 = blocked str1 = from str2 = state.name }, { "Pulse dropped, pulsePending=$bool1 state=$str1 blocked=$bool2" "Pulse dropped, cannot pulse from=$str1 state=$str2" }) } Loading @@ -243,6 +242,16 @@ class DozeLogger @Inject constructor( }) } fun logPulseEvent(pulseEvent: String, dozing: Boolean, pulseReason: String) { buffer.log(TAG, DEBUG, { str1 = pulseEvent bool1 = dozing str2 = pulseReason }, { "Pulse-$str1 dozing=$bool1 pulseReason=$str2" }) } fun logPulseDropped(reason: String) { buffer.log(TAG, INFO, { str1 = reason Loading
packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +34 −25 Original line number Diff line number Diff line Loading @@ -102,7 +102,6 @@ public class DozeTriggers implements DozeMachine.Part { private final UiEventLogger mUiEventLogger; private long mNotificationPulseTime; private boolean mPulsePending; private Runnable mAodInterruptRunnable; /** see {@link #onProximityFar} prox for callback */ Loading Loading @@ -303,8 +302,8 @@ public class DozeTriggers implements DozeMachine.Part { null /* onPulseSuppressedListener */); } } else { proximityCheckThenCall((result) -> { if (result != null && result) { proximityCheckThenCall((isNear) -> { if (isNear != null && isNear) { // In pocket, drop event. mDozeLog.traceSensorEventDropped(pulseReason, "prox reporting near"); return; Loading Loading @@ -410,8 +409,8 @@ public class DozeTriggers implements DozeMachine.Part { sWakeDisplaySensorState = wake; if (wake) { proximityCheckThenCall((result) -> { if (result != null && result) { proximityCheckThenCall((isNear) -> { if (isNear != null && isNear) { // In pocket, drop event. return; } Loading Loading @@ -537,24 +536,44 @@ public class DozeTriggers implements DozeMachine.Part { return; } if (mPulsePending || !mAllowPulseTriggers || !canPulse()) { if (mAllowPulseTriggers) { mDozeLog.tracePulseDropped(mPulsePending, dozeState, mDozeHost.isPulsingBlocked()); if (!mAllowPulseTriggers || mDozeHost.isPulsePending() || !canPulse()) { if (!mAllowPulseTriggers) { mDozeLog.tracePulseDropped("requestPulse - !mAllowPulseTriggers"); } else if (mDozeHost.isPulsePending()) { mDozeLog.tracePulseDropped("requestPulse - pulsePending"); } else if (!canPulse()) { mDozeLog.tracePulseDropped("requestPulse", dozeState); } runIfNotNull(onPulseSuppressedListener); return; } mPulsePending = true; proximityCheckThenCall((result) -> { if (result != null && result) { mDozeHost.setPulsePending(true); proximityCheckThenCall((isNear) -> { if (isNear != null && isNear) { // in pocket, abort pulse mDozeLog.tracePulseDropped("inPocket"); mPulsePending = false; mDozeLog.tracePulseDropped("requestPulse - inPocket"); mDozeHost.setPulsePending(false); runIfNotNull(onPulseSuppressedListener); } else { // not in pocket, continue pulsing continuePulseRequest(reason); final boolean isPulsePending = mDozeHost.isPulsePending(); mDozeHost.setPulsePending(false); if (!isPulsePending || mDozeHost.isPulsingBlocked() || !canPulse()) { if (!isPulsePending) { mDozeLog.tracePulseDropped("continuePulseRequest - pulse no longer" + " pending, pulse was cancelled before it could start" + " transitioning to pulsing state."); } else if (mDozeHost.isPulsingBlocked()) { mDozeLog.tracePulseDropped("continuePulseRequest - pulsingBlocked"); } else if (!canPulse()) { mDozeLog.tracePulseDropped("continuePulseRequest", mMachine.getState()); } runIfNotNull(onPulseSuppressedListener); return; } mMachine.requestPulse(reason); } }, !mDozeParameters.getProxCheckBeforePulse() || performedProxCheck, reason); Loading @@ -569,16 +588,6 @@ public class DozeTriggers implements DozeMachine.Part { || mMachine.getState() == DozeMachine.State.DOZE_AOD_DOCKED; } private void continuePulseRequest(int reason) { mPulsePending = false; if (mDozeHost.isPulsingBlocked() || !canPulse()) { mDozeLog.tracePulseDropped(mPulsePending, mMachine.getState(), mDozeHost.isPulsingBlocked()); return; } mMachine.requestPulse(reason); } @Nullable private InstanceId getKeyguardSessionId() { return mSessionTracker.getSessionId(SESSION_KEYGUARD); Loading @@ -591,7 +600,7 @@ public class DozeTriggers implements DozeMachine.Part { pw.print(" notificationPulseTime="); pw.println(Formatter.formatShortElapsedTime(mContext, mNotificationPulseTime)); pw.println(" pulsePending=" + mPulsePending); pw.println(" DozeHost#isPulsePending=" + mDozeHost.isPulsePending()); pw.println("DozeSensors:"); IndentingPrintWriter idpw = new IndentingPrintWriter(pw); idpw.increaseIndent(); Loading
packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ public class LogModule { @SysUISingleton @DozeLog public static LogBuffer provideDozeLogBuffer(LogBufferFactory factory) { return factory.create("DozeLog", 100); return factory.create("DozeLog", 120); } /** Provides a logging buffer for all logs related to the data layer of notifications. */ Loading