Doze mode, often called Android Doze, is a system power-saving state that restricts background activity of apps when a device is unplugged, its screen is off and it is not being used. In mobile performance, it is one of the main mechanisms behind long standby battery life on Android, because it groups background work into short maintenance windows instead of letting every app wake the device whenever it wants.
Doze was introduced in Android 6.0 and extended in Android 7.0 with a lighter variant that also works while the device is in a pocket or bag. It applies automatically to all apps, so developers must design background behavior that still works correctly when the system defers it.
How Doze mode works
The system enters Doze after it detects a period of inactivity. In light Doze, which starts shortly after the screen turns off on battery power, the system restricts network access and defers jobs and syncs, but still allows regular maintenance windows. In deep Doze, which additionally requires the device to be stationary as reported by motion sensors, the restrictions become stricter and the gaps between maintenance windows grow longer.
During a maintenance window, the system briefly lifts the restrictions so that apps can run pending jobs, syncs and alarms and use the network. After each window, the device returns to Doze, and in deep Doze the interval before the next window increases progressively, from minutes to several hours if the device stays untouched.
Doze ends immediately when the user turns on the screen, moves the device significantly or plugs in a charger.
Apps can detect the current state through PowerManager.isDeviceIdleMode() and can listen for the system broadcast that announces a change of idle mode. This is useful for diagnostics and for adjusting behavior, for example postponing a large upload until the device leaves Doze, but it does not give an app any way to override the restrictions. User-visible functions such as incoming phone calls, alarm clocks and notifications already delivered continue to work normally while the device dozes.
What Doze restricts
Doze does not freeze apps; it defers specific kinds of background work that would otherwise wake the radio or the CPU. The table summarizes the main restrictions in deep Doze and how each one can be handled.
| Activity | Behavior in Doze | Allowed workaround |
|---|---|---|
| Network access | Suspended for apps | Wait for a maintenance window or a high-priority push |
| Wake locks | Ignored | None for normal apps |
| Standard AlarmManager alarms | Deferred to the next window | Alarms set with the allow-while-idle variants |
| JobScheduler and WorkManager jobs | Deferred | Run automatically in maintenance windows |
| Sync adapters | Deferred | Run in maintenance windows |
| Wi-Fi scans | Stopped | None |
Alarms set with setAndAllowWhileIdle or setExactAndAllowWhileIdle can fire during Doze, but the system limits how often each app may use them, roughly once every nine minutes in deep Doze. Alarms created with setAlarmClock are treated as user-visible and briefly bring the device out of Doze.
Light Doze and deep Doze compared
The two levels differ in when they start and how strict they are. Light Doze provides savings during short idle periods, while deep Doze delivers most of the overnight standby gain.
| Property | Light Doze | Deep Doze |
|---|---|---|
| Introduced in | Android 7.0 | Android 6.0 |
| Device must be stationary | No | Yes |
| Typical entry delay | Minutes after screen off | Longer idle period, often tens of minutes |
| Wake locks and alarms | Mostly unaffected | Wake locks ignored, alarms deferred |
| Maintenance window spacing | Short and regular | Grows to several hours |
Exact entry delays depend on the Android version and are frequently adjusted by device manufacturers, some of which add stricter proprietary battery managers on top of Doze.
Doze mode compared with related power features
Doze is one of several layers of battery optimization on mobile platforms. It is device-wide and triggered by inactivity, while other features target individual apps or are switched on by the user.
| Mechanism | Trigger | Scope |
|---|---|---|
| Doze mode | Device idle, unplugged, screen off | All apps on the device |
| App Standby buckets | How recently and often an app is used | Individual apps |
| Background execution limits | App in the background | Services and broadcasts of each app |
| Battery Saver | User or low battery level | Whole device, including visuals and performance |
| Low Power Mode on iOS | User or prompt at low battery | Whole device on iPhone and iPad |
Designing and testing apps for Doze
The recommended approach is to schedule background work with WorkManager or JobScheduler and accept that it runs in maintenance windows. Time-critical events, such as an incoming chat message or a call, should arrive through high-priority Firebase Cloud Messaging messages, which give the app a short window of network access even in Doze.
Apps can ask the user to exempt them from battery optimizations, but the exemption is intended for narrow cases such as apps whose core function cannot work otherwise, and Google Play reviews requests for the related permission. Overusing it shortens battery life and can lead to policy rejection.
Developers can test behavior without waiting for real idle time by using adb shell dumpsys deviceidle force-idle after simulating an unplugged battery, then stepping through the idle states. Common mistakes include:
- Relying on wake locks to keep a background connection alive overnight.
- Using exact alarms for routine syncing, which drains battery and is deferred anyway.
- Testing only while charging, where Doze never activates.
- Ignoring manufacturer power managers, which can be stricter than stock Android.
Put simply
When an Android phone lies untouched on a table with the screen off, Doze mode puts it into a deep sleep. Apps are not allowed to keep waking the phone to check for updates. Instead, the phone wakes up briefly every so often and lets all apps catch up at once.
This is like a building that switches off most lights at night and checks on things during scheduled rounds. The battery lasts much longer, and as soon as you pick up the phone, everything is fully awake again.
In practice
A fitness app syncs workout data to its server every fifteen minutes using a repeating exact alarm and a wake lock. Users report that the app drains their battery overnight, while syncing still fails at random times when the phone is idle.
The developers replace the alarm with a periodic WorkManager job that requires a network connection and remove the wake lock. They test with forced deep Doze through adb and confirm that pending syncs complete during the next maintenance window. Important events, such as a coach sending a new training plan, now arrive as high-priority push messages.
After the update, overnight battery use attributed to the app drops to almost nothing, and data still reaches the server within minutes of the user waking the phone.