Loading packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +3 −2 Original line number Diff line number Diff line Loading @@ -319,9 +319,10 @@ public class DozeLog implements Dumpable { /** * Appends the doze state that was suppressed to the doze event log * @param suppressedState The {@link DozeMachine.State} that was suppressed * @param reason what suppressed always on */ public void traceAlwaysOnSuppressed(DozeMachine.State suppressedState) { mLogger.logAlwaysOnSuppressed(suppressedState); public void traceAlwaysOnSuppressed(DozeMachine.State suppressedState, String reason) { mLogger.logAlwaysOnSuppressed(suppressedState, reason); } /** Loading packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt +3 −2 Original line number Diff line number Diff line Loading @@ -267,11 +267,12 @@ class DozeLogger @Inject constructor( }) } fun logAlwaysOnSuppressed(state: DozeMachine.State) { fun logAlwaysOnSuppressed(state: DozeMachine.State, reason: String) { buffer.log(TAG, INFO, { str1 = state.name str2 = reason }, { "Always-on state suppressed, suppressed state=$str1" "Always-on state suppressed, suppressed state=$str1 reason=$str2" }) } Loading packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java +7 −2 Original line number Diff line number Diff line Loading @@ -358,8 +358,13 @@ public class DozeMachine { return State.FINISH; } if (mDozeHost.isAlwaysOnSuppressed() && requestedState.isAlwaysOn()) { Log.i(TAG, "Doze is suppressed. Suppressing state: " + requestedState); mDozeLog.traceAlwaysOnSuppressed(requestedState); Log.i(TAG, "Doze is suppressed by an app. Suppressing state: " + requestedState); mDozeLog.traceAlwaysOnSuppressed(requestedState, "app"); return State.DOZE; } if (mDozeHost.isPowerSaveActive() && requestedState.isAlwaysOn()) { Log.i(TAG, "Doze is suppressed by battery saver. Suppressing state: " + requestedState); mDozeLog.traceAlwaysOnSuppressed(requestedState, "batterySaver"); return State.DOZE; } if ((mState == State.DOZE_AOD_PAUSED || mState == State.DOZE_AOD_PAUSING Loading packages/SystemUI/src/com/android/systemui/doze/DozeService.java +3 −1 Original line number Diff line number Diff line Loading @@ -136,6 +136,8 @@ public class DozeService extends DreamService @Override public void setDozeScreenState(int state) { super.setDozeScreenState(state); if (mDozeMachine != null) { mDozeMachine.onScreenState(state); } } } packages/SystemUI/src/com/android/systemui/doze/DozeSuppressor.java +4 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,8 @@ public class DozeSuppressor implements DozeMachine.Part { private DozeHost.Callback mHostCallback = new DozeHost.Callback() { @Override public void onPowerSaveChanged(boolean active) { // handles suppression changes, while DozeMachine#transitionPolicy handles gating // transitions to DOZE_AOD DozeMachine.State nextState = null; if (mDozeHost.isPowerSaveActive()) { nextState = DozeMachine.State.DOZE; Loading @@ -182,6 +184,8 @@ public class DozeSuppressor implements DozeMachine.Part { @Override public void onAlwaysOnSuppressedChanged(boolean suppressed) { // handles suppression changes, while DozeMachine#transitionPolicy handles gating // transitions to DOZE_AOD final DozeMachine.State nextState; if (mConfig.alwaysOnEnabled(UserHandle.USER_CURRENT) && !suppressed) { nextState = DozeMachine.State.DOZE_AOD; Loading Loading
packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +3 −2 Original line number Diff line number Diff line Loading @@ -319,9 +319,10 @@ public class DozeLog implements Dumpable { /** * Appends the doze state that was suppressed to the doze event log * @param suppressedState The {@link DozeMachine.State} that was suppressed * @param reason what suppressed always on */ public void traceAlwaysOnSuppressed(DozeMachine.State suppressedState) { mLogger.logAlwaysOnSuppressed(suppressedState); public void traceAlwaysOnSuppressed(DozeMachine.State suppressedState, String reason) { mLogger.logAlwaysOnSuppressed(suppressedState, reason); } /** Loading
packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt +3 −2 Original line number Diff line number Diff line Loading @@ -267,11 +267,12 @@ class DozeLogger @Inject constructor( }) } fun logAlwaysOnSuppressed(state: DozeMachine.State) { fun logAlwaysOnSuppressed(state: DozeMachine.State, reason: String) { buffer.log(TAG, INFO, { str1 = state.name str2 = reason }, { "Always-on state suppressed, suppressed state=$str1" "Always-on state suppressed, suppressed state=$str1 reason=$str2" }) } Loading
packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java +7 −2 Original line number Diff line number Diff line Loading @@ -358,8 +358,13 @@ public class DozeMachine { return State.FINISH; } if (mDozeHost.isAlwaysOnSuppressed() && requestedState.isAlwaysOn()) { Log.i(TAG, "Doze is suppressed. Suppressing state: " + requestedState); mDozeLog.traceAlwaysOnSuppressed(requestedState); Log.i(TAG, "Doze is suppressed by an app. Suppressing state: " + requestedState); mDozeLog.traceAlwaysOnSuppressed(requestedState, "app"); return State.DOZE; } if (mDozeHost.isPowerSaveActive() && requestedState.isAlwaysOn()) { Log.i(TAG, "Doze is suppressed by battery saver. Suppressing state: " + requestedState); mDozeLog.traceAlwaysOnSuppressed(requestedState, "batterySaver"); return State.DOZE; } if ((mState == State.DOZE_AOD_PAUSED || mState == State.DOZE_AOD_PAUSING Loading
packages/SystemUI/src/com/android/systemui/doze/DozeService.java +3 −1 Original line number Diff line number Diff line Loading @@ -136,6 +136,8 @@ public class DozeService extends DreamService @Override public void setDozeScreenState(int state) { super.setDozeScreenState(state); if (mDozeMachine != null) { mDozeMachine.onScreenState(state); } } }
packages/SystemUI/src/com/android/systemui/doze/DozeSuppressor.java +4 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,8 @@ public class DozeSuppressor implements DozeMachine.Part { private DozeHost.Callback mHostCallback = new DozeHost.Callback() { @Override public void onPowerSaveChanged(boolean active) { // handles suppression changes, while DozeMachine#transitionPolicy handles gating // transitions to DOZE_AOD DozeMachine.State nextState = null; if (mDozeHost.isPowerSaveActive()) { nextState = DozeMachine.State.DOZE; Loading @@ -182,6 +184,8 @@ public class DozeSuppressor implements DozeMachine.Part { @Override public void onAlwaysOnSuppressedChanged(boolean suppressed) { // handles suppression changes, while DozeMachine#transitionPolicy handles gating // transitions to DOZE_AOD final DozeMachine.State nextState; if (mConfig.alwaysOnEnabled(UserHandle.USER_CURRENT) && !suppressed) { nextState = DozeMachine.State.DOZE_AOD; Loading