Loading core/java/com/android/internal/statusbar/IStatusBar.aidl +6 −0 Original line number Original line Diff line number Diff line Loading @@ -220,4 +220,10 @@ oneway interface IStatusBar * Notifies SystemUI to stop tracing. * Notifies SystemUI to stop tracing. */ */ void stopTracing(); void stopTracing(); /** * If true, suppresses the ambient display from showing. If false, re-enables the ambient * display. */ void suppressAmbientDisplay(boolean suppress); } } core/java/com/android/internal/statusbar/IStatusBarService.aidl +6 −0 Original line number Original line Diff line number Diff line Loading @@ -139,4 +139,10 @@ interface IStatusBarService * Returns whether SystemUI tracing is enabled. * Returns whether SystemUI tracing is enabled. */ */ boolean isTracing(); boolean isTracing(); /** * If true, suppresses the ambient display from showing. If false, re-enables the ambient * display. */ void suppressAmbientDisplay(boolean suppress); } } packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -102,7 +102,8 @@ public class DozeFactory { wrappedService, mDozeParameters); wrappedService, mDozeParameters); DozeMachine machine = new DozeMachine(wrappedService, config, wakeLock, DozeMachine machine = new DozeMachine(wrappedService, config, wakeLock, mWakefulnessLifecycle, mBatteryController, mDozeLog, mDockManager); mWakefulnessLifecycle, mBatteryController, mDozeLog, mDockManager, mDozeServiceHost); machine.setParts(new DozeMachine.Part[]{ machine.setParts(new DozeMachine.Part[]{ new DozePauser(mHandler, machine, mAlarmManager, mDozeParameters.getPolicy()), new DozePauser(mHandler, machine, mAlarmManager, mDozeParameters.getPolicy()), new DozeFalsingManagerAdapter(mFalsingManager), new DozeFalsingManagerAdapter(mFalsingManager), Loading @@ -118,7 +119,6 @@ public class DozeFactory { new DozeWallpaperState(mWallpaperManager, mBiometricUnlockController, new DozeWallpaperState(mWallpaperManager, mBiometricUnlockController, mDozeParameters), mDozeParameters), new DozeDockHandler(config, machine, mDockManager), new DozeDockHandler(config, machine, mDockManager), new DozeSuppressedHandler(dozeService, config, machine), new DozeAuthRemover(dozeService) new DozeAuthRemover(dozeService) }); }); Loading packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -81,6 +81,9 @@ public interface DozeHost { */ */ void stopPulsing(); void stopPulsing(); /** Returns whether doze is suppressed. */ boolean isDozeSuppressed(); interface Callback { interface Callback { /** /** * Called when a high priority notification is added. * Called when a high priority notification is added. Loading @@ -94,6 +97,9 @@ public interface DozeHost { * @param active whether power save is active or not * @param active whether power save is active or not */ */ default void onPowerSaveChanged(boolean active) {} default void onPowerSaveChanged(boolean active) {} /** Called when the doze suppression state changes. */ default void onDozeSuppressedChanged(boolean suppressed) {} } } interface PulseCallback { interface PulseCallback { Loading packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,7 @@ public class DozeMachine { private final AmbientDisplayConfiguration mConfig; private final AmbientDisplayConfiguration mConfig; private final WakefulnessLifecycle mWakefulnessLifecycle; private final WakefulnessLifecycle mWakefulnessLifecycle; private final BatteryController mBatteryController; private final BatteryController mBatteryController; private final DozeHost mDozeHost; private Part[] mParts; private Part[] mParts; private final ArrayList<State> mQueuedRequests = new ArrayList<>(); private final ArrayList<State> mQueuedRequests = new ArrayList<>(); Loading @@ -144,7 +145,7 @@ public class DozeMachine { public DozeMachine(Service service, AmbientDisplayConfiguration config, WakeLock wakeLock, public DozeMachine(Service service, AmbientDisplayConfiguration config, WakeLock wakeLock, WakefulnessLifecycle wakefulnessLifecycle, BatteryController batteryController, WakefulnessLifecycle wakefulnessLifecycle, BatteryController batteryController, DozeLog dozeLog, DockManager dockManager) { DozeLog dozeLog, DockManager dockManager, DozeHost dozeHost) { mDozeService = service; mDozeService = service; mConfig = config; mConfig = config; mWakefulnessLifecycle = wakefulnessLifecycle; mWakefulnessLifecycle = wakefulnessLifecycle; Loading @@ -152,6 +153,7 @@ public class DozeMachine { mBatteryController = batteryController; mBatteryController = batteryController; mDozeLog = dozeLog; mDozeLog = dozeLog; mDockManager = dockManager; mDockManager = dockManager; mDozeHost = dozeHost; } } /** Initializes the set of {@link Part}s. Must be called exactly once after construction. */ /** Initializes the set of {@link Part}s. Must be called exactly once after construction. */ Loading Loading @@ -328,7 +330,7 @@ public class DozeMachine { if (mState == State.FINISH) { if (mState == State.FINISH) { return State.FINISH; return State.FINISH; } } if (mConfig.dozeSuppressed(UserHandle.USER_CURRENT) && requestedState.isAlwaysOn()) { if (mDozeHost.isDozeSuppressed() && requestedState.isAlwaysOn()) { Log.i(TAG, "Doze is suppressed. Suppressing state: " + requestedState); Log.i(TAG, "Doze is suppressed. Suppressing state: " + requestedState); mDozeLog.traceDozeSuppressed(requestedState); mDozeLog.traceDozeSuppressed(requestedState); return State.DOZE; return State.DOZE; Loading Loading
core/java/com/android/internal/statusbar/IStatusBar.aidl +6 −0 Original line number Original line Diff line number Diff line Loading @@ -220,4 +220,10 @@ oneway interface IStatusBar * Notifies SystemUI to stop tracing. * Notifies SystemUI to stop tracing. */ */ void stopTracing(); void stopTracing(); /** * If true, suppresses the ambient display from showing. If false, re-enables the ambient * display. */ void suppressAmbientDisplay(boolean suppress); } }
core/java/com/android/internal/statusbar/IStatusBarService.aidl +6 −0 Original line number Original line Diff line number Diff line Loading @@ -139,4 +139,10 @@ interface IStatusBarService * Returns whether SystemUI tracing is enabled. * Returns whether SystemUI tracing is enabled. */ */ boolean isTracing(); boolean isTracing(); /** * If true, suppresses the ambient display from showing. If false, re-enables the ambient * display. */ void suppressAmbientDisplay(boolean suppress); } }
packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -102,7 +102,8 @@ public class DozeFactory { wrappedService, mDozeParameters); wrappedService, mDozeParameters); DozeMachine machine = new DozeMachine(wrappedService, config, wakeLock, DozeMachine machine = new DozeMachine(wrappedService, config, wakeLock, mWakefulnessLifecycle, mBatteryController, mDozeLog, mDockManager); mWakefulnessLifecycle, mBatteryController, mDozeLog, mDockManager, mDozeServiceHost); machine.setParts(new DozeMachine.Part[]{ machine.setParts(new DozeMachine.Part[]{ new DozePauser(mHandler, machine, mAlarmManager, mDozeParameters.getPolicy()), new DozePauser(mHandler, machine, mAlarmManager, mDozeParameters.getPolicy()), new DozeFalsingManagerAdapter(mFalsingManager), new DozeFalsingManagerAdapter(mFalsingManager), Loading @@ -118,7 +119,6 @@ public class DozeFactory { new DozeWallpaperState(mWallpaperManager, mBiometricUnlockController, new DozeWallpaperState(mWallpaperManager, mBiometricUnlockController, mDozeParameters), mDozeParameters), new DozeDockHandler(config, machine, mDockManager), new DozeDockHandler(config, machine, mDockManager), new DozeSuppressedHandler(dozeService, config, machine), new DozeAuthRemover(dozeService) new DozeAuthRemover(dozeService) }); }); Loading
packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -81,6 +81,9 @@ public interface DozeHost { */ */ void stopPulsing(); void stopPulsing(); /** Returns whether doze is suppressed. */ boolean isDozeSuppressed(); interface Callback { interface Callback { /** /** * Called when a high priority notification is added. * Called when a high priority notification is added. Loading @@ -94,6 +97,9 @@ public interface DozeHost { * @param active whether power save is active or not * @param active whether power save is active or not */ */ default void onPowerSaveChanged(boolean active) {} default void onPowerSaveChanged(boolean active) {} /** Called when the doze suppression state changes. */ default void onDozeSuppressedChanged(boolean suppressed) {} } } interface PulseCallback { interface PulseCallback { Loading
packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,7 @@ public class DozeMachine { private final AmbientDisplayConfiguration mConfig; private final AmbientDisplayConfiguration mConfig; private final WakefulnessLifecycle mWakefulnessLifecycle; private final WakefulnessLifecycle mWakefulnessLifecycle; private final BatteryController mBatteryController; private final BatteryController mBatteryController; private final DozeHost mDozeHost; private Part[] mParts; private Part[] mParts; private final ArrayList<State> mQueuedRequests = new ArrayList<>(); private final ArrayList<State> mQueuedRequests = new ArrayList<>(); Loading @@ -144,7 +145,7 @@ public class DozeMachine { public DozeMachine(Service service, AmbientDisplayConfiguration config, WakeLock wakeLock, public DozeMachine(Service service, AmbientDisplayConfiguration config, WakeLock wakeLock, WakefulnessLifecycle wakefulnessLifecycle, BatteryController batteryController, WakefulnessLifecycle wakefulnessLifecycle, BatteryController batteryController, DozeLog dozeLog, DockManager dockManager) { DozeLog dozeLog, DockManager dockManager, DozeHost dozeHost) { mDozeService = service; mDozeService = service; mConfig = config; mConfig = config; mWakefulnessLifecycle = wakefulnessLifecycle; mWakefulnessLifecycle = wakefulnessLifecycle; Loading @@ -152,6 +153,7 @@ public class DozeMachine { mBatteryController = batteryController; mBatteryController = batteryController; mDozeLog = dozeLog; mDozeLog = dozeLog; mDockManager = dockManager; mDockManager = dockManager; mDozeHost = dozeHost; } } /** Initializes the set of {@link Part}s. Must be called exactly once after construction. */ /** Initializes the set of {@link Part}s. Must be called exactly once after construction. */ Loading Loading @@ -328,7 +330,7 @@ public class DozeMachine { if (mState == State.FINISH) { if (mState == State.FINISH) { return State.FINISH; return State.FINISH; } } if (mConfig.dozeSuppressed(UserHandle.USER_CURRENT) && requestedState.isAlwaysOn()) { if (mDozeHost.isDozeSuppressed() && requestedState.isAlwaysOn()) { Log.i(TAG, "Doze is suppressed. Suppressing state: " + requestedState); Log.i(TAG, "Doze is suppressed. Suppressing state: " + requestedState); mDozeLog.traceDozeSuppressed(requestedState); mDozeLog.traceDozeSuppressed(requestedState); return State.DOZE; return State.DOZE; Loading