Loading packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ public interface DozeHost { void dozeTimeTick(); boolean isPowerSaveActive(); boolean isPulsingBlocked(); boolean isProvisioned(); void startPendingIntentDismissingKeyguard(PendingIntent intent); void abortPulsing(); Loading @@ -40,6 +41,7 @@ public interface DozeHost { void onDoubleTap(float x, float y); interface Callback { default void onNotificationHeadsUp() {} default void onPowerSaveChanged(boolean active) {} Loading packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +6 −15 Original line number Diff line number Diff line Loading @@ -172,14 +172,6 @@ public class DozeTriggers implements DozeMachine.Part { } } private void onCarMode() { mMachine.requestState(DozeMachine.State.FINISH); } private void onPowerSave() { mMachine.requestState(DozeMachine.State.FINISH); } @Override public void transitionTo(DozeMachine.State oldState, DozeMachine.State newState) { switch (newState) { Loading Loading @@ -215,11 +207,10 @@ public class DozeTriggers implements DozeMachine.Part { } private void checkTriggersAtInit() { if (mUiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR) { onCarMode(); } if (mDozeHost.isPowerSaveActive()) { onPowerSave(); if (mUiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR || mDozeHost.isPowerSaveActive() || !mDozeHost.isProvisioned()) { mMachine.requestState(DozeMachine.State.FINISH); } } Loading Loading @@ -355,7 +346,7 @@ public class DozeTriggers implements DozeMachine.Part { requestPulse(DozeLog.PULSE_REASON_INTENT, false /* performedProxCheck */); } if (UiModeManager.ACTION_ENTER_CAR_MODE.equals(intent.getAction())) { onCarMode(); mMachine.requestState(DozeMachine.State.FINISH); } if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction())) { mDozeSensors.onUserSwitched(); Loading Loading @@ -391,7 +382,7 @@ public class DozeTriggers implements DozeMachine.Part { @Override public void onPowerSaveChanged(boolean active) { if (active) { onPowerSave(); mMachine.requestState(DozeMachine.State.FINISH); } } }; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +6 −0 Original line number Diff line number Diff line Loading @@ -5370,6 +5370,12 @@ public class StatusBar extends SystemUI implements DemoMode, == FingerprintUnlockController.MODE_WAKE_AND_UNLOCK; } @Override public boolean isProvisioned() { return mDeviceProvisionedController.isDeviceProvisioned() && mDeviceProvisionedController.isCurrentUserSetup(); } @Override public void startPendingIntentDismissingKeyguard(PendingIntent intent) { StatusBar.this.startPendingIntentDismissingKeyguard(intent); Loading packages/SystemUI/tests/src/com/android/systemui/doze/DozeHostFake.java +5 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,11 @@ class DozeHostFake implements DozeHost { return false; } @Override public boolean isProvisioned() { return false; } @Override public void startPendingIntentDismissingKeyguard(PendingIntent intent) { throw new RuntimeException("not implemented"); Loading Loading
packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ public interface DozeHost { void dozeTimeTick(); boolean isPowerSaveActive(); boolean isPulsingBlocked(); boolean isProvisioned(); void startPendingIntentDismissingKeyguard(PendingIntent intent); void abortPulsing(); Loading @@ -40,6 +41,7 @@ public interface DozeHost { void onDoubleTap(float x, float y); interface Callback { default void onNotificationHeadsUp() {} default void onPowerSaveChanged(boolean active) {} Loading
packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +6 −15 Original line number Diff line number Diff line Loading @@ -172,14 +172,6 @@ public class DozeTriggers implements DozeMachine.Part { } } private void onCarMode() { mMachine.requestState(DozeMachine.State.FINISH); } private void onPowerSave() { mMachine.requestState(DozeMachine.State.FINISH); } @Override public void transitionTo(DozeMachine.State oldState, DozeMachine.State newState) { switch (newState) { Loading Loading @@ -215,11 +207,10 @@ public class DozeTriggers implements DozeMachine.Part { } private void checkTriggersAtInit() { if (mUiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR) { onCarMode(); } if (mDozeHost.isPowerSaveActive()) { onPowerSave(); if (mUiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR || mDozeHost.isPowerSaveActive() || !mDozeHost.isProvisioned()) { mMachine.requestState(DozeMachine.State.FINISH); } } Loading Loading @@ -355,7 +346,7 @@ public class DozeTriggers implements DozeMachine.Part { requestPulse(DozeLog.PULSE_REASON_INTENT, false /* performedProxCheck */); } if (UiModeManager.ACTION_ENTER_CAR_MODE.equals(intent.getAction())) { onCarMode(); mMachine.requestState(DozeMachine.State.FINISH); } if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction())) { mDozeSensors.onUserSwitched(); Loading Loading @@ -391,7 +382,7 @@ public class DozeTriggers implements DozeMachine.Part { @Override public void onPowerSaveChanged(boolean active) { if (active) { onPowerSave(); mMachine.requestState(DozeMachine.State.FINISH); } } }; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +6 −0 Original line number Diff line number Diff line Loading @@ -5370,6 +5370,12 @@ public class StatusBar extends SystemUI implements DemoMode, == FingerprintUnlockController.MODE_WAKE_AND_UNLOCK; } @Override public boolean isProvisioned() { return mDeviceProvisionedController.isDeviceProvisioned() && mDeviceProvisionedController.isCurrentUserSetup(); } @Override public void startPendingIntentDismissingKeyguard(PendingIntent intent) { StatusBar.this.startPendingIntentDismissingKeyguard(intent); Loading
packages/SystemUI/tests/src/com/android/systemui/doze/DozeHostFake.java +5 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,11 @@ class DozeHostFake implements DozeHost { return false; } @Override public boolean isProvisioned() { return false; } @Override public void startPendingIntentDismissingKeyguard(PendingIntent intent) { throw new RuntimeException("not implemented"); Loading