There is a recurring question every time we talk about autonomy in our Android devices: How can we make the battery last longer without losing essential functionality? Since the arrival of Android 6.0 Marshmallow, that response has had a name: Doze. Although many users have heard of it, few actually know how this system works, how it has evolved, and in what situations it really makes a difference.
In this article we are going to go into depth about What is Doze, what is it for, how has it improved over time, and how you can optimize or adjust its settings If you want to get even more out of it, it's useful for both users looking for a simple explanation and those who want to understand the technical behavior behind the power-saving mode that changed the way Android handles tasks while idle. Get ready to discover all the ins and outs of Doze mode without leaving out a single relevant feature or useful tip.
What is Doze and how did it come about on Android?
Doze is the battery-saving system developed by Google and natively integrated starting with Android 6.0 Marshmallow. Its main objective is to reduce energy consumption when the device is not in use by postponing or limiting the activities of apps running in the background.
Before Doze existed, Android already had Project Volta in Android 5.0 Lollipop, which attempted to optimize battery life. However, its results weren't entirely convincing. It wasn't with Marshmallow that Google finally introduced a truly efficient and automated system that intelligently hibernates the device when it detects inactivity, achieving a notable improvement in autonomy compared to previous versions.
The idea is simple but powerful: detect periods of inactivity and minimize system energy consumption and applications, but allowing priority tasks (such as critical alarms or notifications) to continue running thanks to a system of exceptions and maintenance windows.
How Doze Works in Detail: The Smart Hibernation Mechanism
The key to Doze's success lies in its ability to detect when a device is truly idleThis mode comes into play under a series of carefully thought-out conditions:
- Screen off: The mobile phone must have the screen completely turned off.
- It should not be loading: If your device is connected to power, Doze won't activate.
- The device must remain stationary: Motion sensors (accelerometers, gyroscopes, etc.) shouldn't detect activity, so it won't activate if your phone, for example, is in your pocket while you're walking.
- No high-priority applications should be left running (such as alarms, urgent calls, etc.).
- Communication with Google Play Services: It is required for Doze mode to work and exception handling.
When these conditions are met, Doze kicks in and hibernates the systemWhat does this really mean? Android limits CPU and network activity for background apps to a minimum, postponing most syncing, internet access, and non-critical tasks. Only during very brief maintenance windows does the system "wake up" the device to allow all apps to sync pending data, send notifications, or perform scheduled tasks.
In practice, this means that energy consumption at rest is drastically reduced.Users who don't use their phones intensively will notice the difference: they'll be able to leave their device on for several hours or even days without any noticeable battery drain, something unthinkable before the arrival of Doze.
Which tasks are limited and which are allowed during Doze mode?
The system imposes several severe restrictions while Doze is active. Some of the most important ones to keep in mind are:
- Networks: Access to any type of network (WiFi, mobile data) is completely suspended, except during maintenance windows.
- alarms: All non-critical alarms are snoozed. Specific functions for critical alarms can continue to function.
- Synchronizations and tasks: Apps cannot sync or run scheduled tasks outside of maintenance windows.
- GPS and other sensors: They are disabled to save battery.
- Wakelocks: Apps cannot use wakelocks to prevent the device from entering deep sleep.
Now, they always exist exceptions For essential functions or critical system apps. For example, apps like alarm clocks, emergency messaging, or security services can request a high-priority mode to operate even when Doze mode is enabled. Additionally, Android allows the user to manually configure which apps can ignore this power-saving mode and remain optimized to run in the background.
Doze Evolution with New Android Versions
Android N (7.0 Nougat) marked a leap in quality in Doze management.One of the biggest changes is that the system no longer requires the device to remain completely still: the screen simply being off and not charging is enough to activate power-saving mode, even if you're carrying it in your pocket. This makes power saving applicable in many more everyday situations.
Another important improvement introduced was the inclusion of two levels of hibernation:
- Level 1 (Regular Doze): App syncing is delayed, network access is suspended, and the system allows maintenance windows more frequently.
- Level 2 (Deep Doze): After a longer period of inactivity, the system imposes even more limitations: wakelocks, alarms, GPS, and Wi-Fi signal scanning are completely disabled. Battery consumption at this second level is practically residual.
With these novelties Doze can even work on the go, although the greatest savings still occur when the phone is stationary, for example at night.
How Doze affects apps and users
One of the key points of Doze is how to manage third-party apps and their background tasksApps can be affected in the following ways:
- Notifications and messages: Instant messages, email, and social media may experience delays if apps aren't prioritized, as notifications may be put on hold until the next maintenance window.
- Automatic synchronizations: Applications that rely on real-time synchronized data may display information with some delay.
- Downloads and updates: Any scheduled tasks or background downloads can be postponed.
However, Doze is designed to be smart. Apps can request to be excluded from optimization If the user allows it, for example, messaging apps important for work or security. In addition, Google has developed systems such as Firebase Cloud Messaging (FCM) which allows apps to receive high-priority messages even in Doze mode, ensuring immediate delivery of urgent notifications.
Steps to set up Doze and further optimize your battery
Android offers the possibility of Customize how Doze interacts with apps from the system itself, in a fairly simple way:
- Accede to Settings > Apps and notifications.
- Select the app you want to adjust.
- Within the app options, look for the section Battery and then enter Battery optimization.
- Choose whether you want Doze to manage the app or ignore optimizations. This way, you can ensure you don't miss important notifications in key apps like WhatsApp, Gmail, and more.
This flexibility allows you to adjust Doze’s behavior to suit your needs and priorities.
Third-party applications and advanced settings for demanding users
If you are one of those who seek get the most out of every mAh from your battery or you like to customize every last parameter, there are advanced apps like nap time o Doze Settings Editor that allow you to manually modify Doze's settings. Using these tools, you can define:
- The amount of idle time before Doze kicks in.
- The behavior of the sensors during rest.
- The aggressiveness of the restrictions applied to apps.
Yes, usually require ROOT permissions or the use of ADB commands to be able to modify the internal parameters of the system. For example, if you don't have root, you can activate certain options using a simple command from your computer (adb shell), which is very useful for advanced users.
The role of apps that promise Doze in older versions
Numerous apps have appeared on Google Play that attempt to mimic Doze's behavior on Android versions prior to Marshmallow. However, They do not offer the same benefits and can raise security or privacy issues. Some resort to creating local networks (like VPNs) to monitor data in the background, but this offers little real savings and can expose your personal data.
It is not recommended to use these third-party applications. Unless you absolutely trust the developer and know exactly what they're doing, Doze is generally deeply integrated into Android code and can only be used on versions 6.0 or higher.
Doze Mode and App Standby: Key Doze Add-ons
From Marshmallow, Google has added two complementary features called Doze and App Standby., which work hand in hand to maximize battery life:
- Rest (Doze): It reduces power consumption by suspending almost all CPU and network activity during periods of inactivity, as we have explained.
- App Standby: It is responsible for postponing network activity from applications that have not been used recently, restricting their access to the Internet and background tasks.
Both features are activated automatically and affect all applications, regardless of whether they are backported or not. This ensures overall system energy savings.
An important feature is that the system releases apps from standby when the phone is plugged into the power supply, allowing all pending tasks and synchronizations to be executed at once, optimizing the user experience.
Accepted use cases for Doze mode exemption
Google is very strict about allowing apps to request direct exemption from power-saving features. This is only considered in very specific situations:
- Instant messaging or real-time calling: We recommend using Firebase Cloud Messaging in high-priority mode. You can only request exclusion if Doze critically impacts core functionality.
- Security applications: Such as family protection apps or emergency location apps.
- Automation of critical tasks: Apps whose main function is to execute important automatic actions such as backups, alarm calls, etc.
- Peripheral Device Applications (Accessories): If they need to be permanently connected to provide Internet access or continuous synchronization.
In all other cases, Google Play prohibits apps from requesting exemption without a clear technical justification.This prevents abuse that would negatively impact the device's battery life.
Tips and recommendations for users and developers
If you are a user, No advanced settings are required to benefit from Doze: It's enabled by default on all Android 6.0 or higher devices and works automatically. However, if you need certain apps to work even during power saving mode, remember to whitelist them in your battery settings.
For developers, it is essential adapt applications to properly manage state changes (maintenance windows, network restrictions, task postponement, etc.). It is recommended to use Firebase Cloud Messaging for important notifications and alarms, as well as the methods setAndAllowWhileIdle() o setExactAndAllowWhileIdle() to schedule alarms to run even in Doze mode (with certain frequency limitations).
In addition, it is highly advisable Thoroughly test apps on devices with Doze and Standby, using ADB commands to manually force these modes and verify that the app responds correctly when returning to the active state.