AOD provides an alternatative 'screen-off' experience. Instead, of completely turning the display off, it provides a distraction-free, glanceable experience for the phone in a low-powered mode. In this low-powered mode, the display will have a lower refresh rate and the UI should frequently shift its displayed contents in order to prevent burn-in.
The default doze component is specified by config_dozeComponent
in the framework config. SystemUI provides a default Doze Component: DozeService. DozeService builds a DozeMachine with dependencies specified in DozeModule and configurations in AmbientDisplayConfiguration and DozeParameters.
DozeMachine handles the following main states:
Device is asleep and listening for enabled pulsing and wake-up gesture triggers. In this state, no UI shows.
Device is asleep, showing UI, and listening for enabled pulsing and wake-up triggers. In this state, screen brightness is handled by DozeScreenBrightness which uses the brightness sensor specified by doze_brightness_sensor_type
in the SystemUI config. To save power, this should be a low-powered sensor that shouldn't trigger as often as the light sensor used for on-screen adaptive brightness.
Device is asleep and would normally be in state DOZE_AOD
; however, instead the display is temporarily off since the proximity sensor reported near for a minimum abount of time. DozePauser handles transitioning from DOZE_AOD_PAUSING
after the minimum timeout after the NEAR is reported by the proximity sensor from DozeTriggers).
Device is awake and showing UI. This is state typically occurs in response to incoming notification, but may also be from other pulse triggers specified in DozeTriggers.
Device is awake, showing docking UI and listening for enabled pulsing and wake-up triggers. The default DockManager is provided by an empty interface at DockManagerImpl. SystemUI should override the DockManager for the DozeService to handle docking events.
DozeDockHandler listens for Dock state changes from DockManager and updates the doze docking state.
Doze sensors are registered in DozeTriggers via DozeSensors. Sensors can be configured per posture for foldable devices.
Relevant sensors include:
And are configured in the AmbientDisplayConfiguration with some related configurations specified in DozeParameters.
Enable DozeLog to print directly to logcat:
adb shell settings put global systemui/buffer/DozeLog v
Enable all DozeService logs to print directly to logcat:
adb shell setprop log.tag.DozeService DEBUG
Other helpful dumpsys commands (adb shell dumpsys <service>
):