Modern smartphones can work for days without recharging, largely thanks to intelligent energy saving algorithms. One of the key optimization mechanisms in the ecosystem Google is a function known as Android Doze mode. This mode automatically puts the device into a deep sleep state when not in use, thereby significantly extending battery life.
However, the introduction of this technology also has a downside: users often experience delays in receiving notifications from instant messengers or email clients. Understanding exactly how this mechanism works will allow you to find a balance between saving battery power and receiving important information in a timely manner.
In this article we will examine in detail the principles of operation sleep mode, the stages of its activation and how to manage exceptions for mission-critical applications. You will find out why your phone can be โsilentโ for hours while lying on the table, and how to fix it without turning off the entire energy saving system.
Principles of energy saving in Android
Initially Doze mode was presented in the version Android 6.0 Marshmallow and has since undergone significant changes. The basic idea is to limit background app activity when the device is at rest. The system analyzes the state of motion sensors and the screen to determine whether the owner is currently using the gadget.
When the phone lies motionless on the table with the screen turned off, the operating system goes into a special mode. In this state, access to the network and CPU time for background tasks are strictly limited. Network connections suspended, and data synchronization is deferred until the next "maintenance window".
โ ๏ธ Attention: Aggressive power saving settings from third-party manufacturers (for example, Xiaomi, Huawei, Samsung) can impose additional restrictions on top of the standard Doze, which often leads to complete blocking of notifications.
It is important to distinguish between the state when the screen is simply turned off by the user, and the state of complete rest of the device. In the first case, the system still allows some background activity, while in the second, the most stringent energy saving protocols are enabled. This difference is critical to understanding why instant messengers work differently in your pocket and on your desk.
Stages of activating sleep mode
The process of transitioning to the state Deep Sleep does not happen instantly. The system uses a phased approach to avoid disrupting applications that require a short time to complete background operations. Understanding these steps will help you diagnose message delivery problems.
First, the device enters a "light sleep" state, where the screen is turned off but the phone can move. If the gadget remains motionless for a certain time (usually about 30 minutes), a full-fledged one is launched. At this stage, the system begins to group network requests. Doze mode. At this stage, the system begins to group network requests.
- ๐ฑ Screen is off: the device goes into standby mode, but background processes are not yet strictly limited.
- ๐ The device is motionless: sensors record the absence of movement, the countdown to deep sleep begins.
- ๐ค Doze activation: network activity is blocked, only high-priority notifications remain available.
- โฐ Windows maintenance: the system periodically (once every few hours) briefly turns on the network for synchronization.
Intervals between maintenance windows increase the longer the device is idle. At first, synchronization occurs every 15 minutes, then the interval increases to 30 minutes, an hour or more. This exponential increase in pauses is what provides the bulk of the battery savings.
Technical details of maintenance windows
In early versions of Android, maintenance windows were fixed, but in modern versions Android 12-14 the algorithm has become more adaptive, taking into account the usage patterns of a particular user.
Impact on notifications and background tasks
The most noticeable effect for the user Android Doze mode is the delay of push notifications. Applications not included in the exception list cannot maintain a persistent connection to the server. Instead of instant delivery, the message is buffered and arrives on the device only during the next service window.
This is especially true for applications that do not use services Google Firebase Cloud Messaging (FCM) correctly. If the application developer has configured background work through standard alarms or custom synchronization services, they will be frozen by the system until the system wakes from sleep.
However, there are mechanisms to bypass these restrictions for critical events. High priority messages, such as incoming calls or emergency alerts, may wake up the device. To do this, a special priority flag is used in the application code, which signals the system about the importance of the event.
โ ๏ธ Attention: Abuse of high-priority notifications by developers can lead to the system ignoring their requests, classifying the application as a violator of energy saving rules.
Users often confuse the work Doze with background activity restrictions introduced in later versions of Android (App Standby Buckets). Although these mechanisms are related, they work on different principles: the first depends on the physical state of the device, the second on the frequency of use of the application by the user.
If it is critical for you to receive notifications from a particular application instantly, add it to the power saving mode exceptions, but be prepared for increased battery consumption.
How to set up exceptions for applications
In order for important applications to work without delays, they are necessary add to the white list. The settings interface may differ depending on the manufacturer's shell, but the general principle remains the same for the entire ecosystem Android. You will need to find the section responsible for optimizing the battery.
Most often, the desired item is located along the path Settings โ Applications โ Special access โ Battery optimization. In some firmware this path may look like Settings โ Battery โ Application mode. Here you will see a list of all installed apps.
- ๐ Search for an application: find in the list the messenger or email that requires instant notifications.
- โ๏ธ Change status: switch the toggle switch to the "Do not optimize" or "No restrictions" position.
- โ Confirmation: the system will warn about a possible increase in energy consumption, agree to the changes.
After making changes, the application gains the right to ignore restrictions Doze mode and maintain a constant network connection even when the screen is off. This guarantees the delivery of messages in real time, but requires the application to competently implement background processes.
โ๏ธ Check notification settings
Diagnostics and statistics analysis via ADB
For advanced users who want to know exactly what is happening with their device, there is a powerful command tool lines Android Debug Bridge (ADB). With its help, you can get detailed statistics on the operation of the sleep mode and see which applications wake up the phone most often.
To obtain summary information about the battery status and mode Doze use the command dumpsys batterystats. It outputs a huge amount of data, so it is better to filter the output, leaving only the necessary sections. This allows you to see the history of transitions to sleep mode and the duration of such periods.
adb shell dumpsys batterystats --charged
A more specific command dumpsys deviceidle allows you to see the current state of Idle mode. In the output you will find parameters such as Light doze and Deep doze, as well as counters of transitions between states. This will help you understand whether your device enters deep sleep at all.
| Parameter | Description | Normal value |
|---|---|---|
mIdleSince |
Time elapsed since the start of idle | Increases when the phone is not touch |
mLightDozeSince |
Time in light sleep mode | Must be greater than zero |
mDeepDozeSince |
Time in deep sleep mode | Appears after 30+ minutes of rest |
mNumDeepDozes |
Number of inputs to deep sleep | Increases during the day |
Using this data, you can identify the โculpritsโ of frequent awakenings. If the deep sleep counter does not increase, it means that some application is constantly holding wakelock, preventing the phone from falling asleep. This is the main reason why the battery drains quickly in standby mode.
ADB commands provide an objective picture of how the system manages power, allowing you to find hidden processes that are preventing you from saving energy.
Forced testing of Doze mode
Sometimes you need to test the sleep mode without waiting for long periods of inactivity. Developers and testers use special ADB commands to force the device into Dozestate. This allows you to quickly verify that the exception settings work correctly.
To activate the mode, enter the command adb shell dumpsys deviceidle force idle. The device will instantly go into a deep sleep state, simulating a long period of inactivity. In this state, you can check whether notifications are received from applications that are not added to exceptions.
โ ๏ธ Warning: Forcing sleep mode may temporarily disrupt network connections and synchronization. Use this function only for testing and do not keep the phone in this state for a long time.
To take the device out of test mode, use the command adb shell dumpsys deviceidle unforce. The system will return to normal power management algorithm. You can also use the command step to step through all stages of falling asleep.
adb shell dumpsys deviceidle step deep
This approach is useful when debugging your own applications or when setting up corporate devices where strict control over background activity is required. It allows you to emulate conditions that in reality only occur at night or when the phone is forgotten at home.
The secret of a quick check
After the forced sleep command, try sending a message to Telegram or WhatsApp. If the application is not in exceptions, the message will not arrive until you cancel the mode or turn on the screen (which will interrupt Doze).
Frequently asked questions about Doze Mode
Why do notifications come in batches after a few hours?
This is normal behavior Doze mode. The system accumulates network requests from non-optimized applications and delivers them simultaneously during the "maintenance window" in order to turn on the radio module less frequently and save battery power.
Does sleep mode affect alarms and timers?
No, standard alarms and timers set through The system application Clock has high priority and works on time even in Deep Sleepmode. However, third-party alarm applications may be delayed if they are not added to exceptions.
Is it possible to completely disable Doze mode on Android?
It is impossible to completely disable the system mechanism without root access, since it is integrated into the system kernel. However, you can add all the necessary applications to the list of exceptions, which actually neutralizes its impact on your use case.
Why does the mode work differently on different phones?
Smartphone manufacturers (Samsung, Xiaomi, Honor) often modify the standard one Androidby adding their own aggressive algorithms for killing background processes. This can increase the effect of delays compared to pure Android on devices Google Pixel.
How to check if my phone is sleeping right now?
The easiest way is to use the ADB command dumpsys deviceidle and see the status. If you see mState=IDLE or DEEP_DOZE, then the mode is active. Without a computer, you can indirectly judge the delay of notifications from non-essential applications.