Many users are faced with a situation where instant messengers stop delivering messages, music players go silent, and activity trackers reset data as soon as the smartphone screen goes dark. This is not a random glitch, but an aggressive energy saving policy of modern Android versions. Smartphone manufacturers strive to maximize battery life by mercilessly “putting to sleep” any processes that are not in the user’s focus.
To The application was running constantlyit is necessary to comprehensively change the approach to managing the device’s power and memory. Standard settings are often not enough, since each brand (Samsung, Xiaomi, Huawei) adds its own algorithms that may conflict with Google’s system rules. In this article, we will look at how to set up exceptions, disable battery optimization, and prevent services from being forced to stop.
It is important to understand that constantly running in the background increases battery consumption. However, for mission-critical services such as navigation, health monitoring or work chats, connection stability is more important than saving a few percent of energy. We will look at methods from simple switches in the menu to advanced settings through engineering menus and ADB.
System battery settings and exclusion from optimization
The first and most important step is to disable system battery optimization for a specific application. Android by default considers that any app minimized to the background can be stopped to save resources. You need to explicitly indicate to the system that this application is an exception to this rule.
Go to Settings → Applications and find the desired service in the list. Go to section Battery or Charge consumption. Here you will see several operating modes. Select option "No restrictions", "No optimize" or "Allow background activity". The name of the item may differ depending on the manufacturer's shell, but the essence is always the same - to prevent the system from limiting the operation of the app.
On some devices, especially from Xiaomi and Huawei, this may not be enough. In such cases, you need to go to the advanced battery settings through a hidden menu or a special security application preinstalled by the manufacturer. There you need to find the startup list and check the box next to the desired application, allowing it to run in the background even after clearing the memory.
⚠️ Attention: Disabling battery optimization causes the application to consume energy even in standby mode. Make sure you trust this software, as malware can use this mode to secretly mine or collect data.
Check if you have global power saving mode enabled. If the "Energy Saving" or «Ultra Power Saving»mode is activated, it will forcefully stop all background processes, ignoring individual application settings. Disable this mode for services to work correctly.
If you use Do Not Disturb mode, check its settings: sometimes it blocks not only sound, but also background data synchronization for certain categories of applications.
Memory management and blocking in recent applications
Random access memory (RAM) in Android is designed in such a way that when there is a lack of free resources, the system begins to close the least used processes. Even if you have disabled battery optimization, the memory manager may unload an application to make room for a new game or a heavy browser.
To lock an application into memory, use the lock feature in the recent tasks menu. Open the list of running applications (usually swipe up or use the square button). Find the application card you want and hold your finger on it or pull it down (depending on the model). A lock icon will appear. Now, even if you click "Close All", this application will remain active.
Another effective method is to disable the memory cleaning function for specific apps. In the developer settings or in the memory management menu of some shells there is an item Cleaning exceptions. Add messengers and important services there. This will prevent them from being unloaded when manually clearing the cache through system utilities.
- 🔒 Pin the application in the recent tasks menu with a lock icon.
- 🧹 Add the service to the exceptions of the memory cleaning system.
- 🚀 Disable automatic closing of background processes in the developer settings.
It is worth noting that constantly keeping an application in memory can lead to RAM fragmentation and a slight slowdown in the interface on older devices with a small amount of RAM (less than 4 GB). On modern flagships with 8-12 GB of memory, this effect is almost unnoticeable.
Specific settings for different manufacturers
The problem of background work is most acute on smartphones from Chinese brands such as Xiaomi, Oppo, Vivo and Huawei. Their proprietary shells (MIUI, ColorOS, Funtouch OS) have extremely aggressive algorithms for killing processes, which often override the standard Android settings.
On Xiaomi devices with the MIUI or HyperOS shell, you need to go to the application Security. There, find the section "Battery" and go to Activity control. Set the value "No restrictions" for the desired application. Also check the section Autostart and turn on the toggle switch opposite the app.
For For Samsung smartphones, setting Sleep in standby mode and "Deep sleep"is important. Go to Settings → Device maintenance → Battery → Restrictions in the background. Make sure the app is not listed as "Deep Sleep Apps." If it is there, remove it from there, otherwise the system will block its operation as soon as the screen goes dark.
| Brand | Path to settings | Key parameter |
|---|---|---|
| Xiaomi / Redmi | Security → Battery | Activity control: “No restrictions” |
| Samsung | Battery → Background restrictions | Exclude from "Deep Sleep" |
| Huawei / Honor | Phone Manager → Launching applications | Autostart: On, Indirect launch: On |
| Oppo / Realme | Phone Manager → Permissions | Autostart and “Save to memory” |
Owners of Asus and Sony devices are usually luckier: their shells are closer to stock Android, so the standard “No restrictions” settings in the battery menu are often enough for stable operation.
Secret setting for MIUI
Some versions of MIUI have a hidden code ##6485##that shows detailed battery statistics. Although you cannot change the settings there, it helps to understand exactly how much energy the application consumes in the background.
Notification and data access settings
Often an application runs in the background, but the user does not see the result of its work, because notifications or Internet access are blocked in sleep mode. Android 10 and above introduced strict restrictions on data transfer when the screen is off.
Go to Settings → Applications → [Your application] → Mobile data and Wi-Fi. Activate the switch "Background mode" (Background data). Without this permission, the application will only be able to connect to the server when it is open on the screen. Also enable the option "Do not limit transmission data"if available.
Pay attention to the notification settings. Go to the Notifications section inside the application card. Make sure all notification categories are enabled and given high priority. In some cases, it is useful to set the notification type to "Important" or "Urgent", which will allow it to bypass Do Not Disturb mode and appear on the locked screen.
⚠️ Warning: On Android 12 and later, zooming to the lock screen may automatically turn off some types of notifications to protect your privacy. Check your lock screen settings in the Security section.
If the app uses geolocation, check your location permissions. Select the mode “Always allowed”rather than “Only during use”. Without this, jog trackers or navigators will stop recording the route as soon as you close the application.
Permission for data transfer in the background and access to geolocation “always” are two critical parameters, without which constant operation of the service is impossible.
Advanced methods: Disabling adaptive brightness and sleep
For scenarios when the phone is used as an information board, smart home control panel or terminal, it is required that the screen is not at all extinguished Standard settings allow you to increase the time before the screen turns off to 10-30 minutes, but not turn it off completely.
In the menu Settings → Display → Screen timeout select the maximum value. If you need to keep the screen lit for hours, use the function "Keep the screen on" in the developer menu. To get there, press 7 times on Build number in the section "About phone".
In the developers menu, find the item Keep screen on (Stay awake). Activate it. Now the screen will remain lit while the phone is connected to the charger. This is an ideal mode for desktop solutions.
adb shell settings put system screen_off_timeout 2147483647
This command via ADB (Android Debug Bridge) sets the screen timeout to the maximum possible value available in the system. However, remember that constant display operation carries the risk of matrix burn-in (especially on AMOLED screens) and serious heating of the device.
- ⏱️ Set the maximum timeout in the normal settings.
- 🔌 Use the “Keep the screen on” option when charging.
- 🛠️ Use ADB commands to extend time limits.
To prevent pixel burn-in, it is recommended to use applications that periodically shift the image slightly or invert colors if the screen must be turned on for a long time.
Diagnosing problems and working with Doze Mode
Even after all the settings, the application may stop working due to the mode Doze. This is an Android system feature that puts the device into deep sleep if it lies still for a long time with the screen off. In this mode, network activity is completely blocked.
Usually the settings listed above (excluding battery optimization) should remove the application from Doze. But if this does not happen, you can try to force the device to wake up from sleep mode to check. Connect your phone to your computer and use the command:
adb shell dumpsys deviceidle force-idle
This command emulates deep sleep mode. To exit it and check the operation of the application, use the command adb shell dumpsys deviceidle unforce. If after exiting the application immediately starts working, then the problem is precisely in the aggressive energy saving settings, which need to be double-checked.
It is also worth checking whether you have third-party memory cleaners or antiviruses with a booster function installed. Such apps often work more aggressively than the system itself and can close applications that you have so carefully configured. Add important services to the white list of such utilities.
⚠️ Attention: Doze mode can be activated even when the screen is on, if the device is not used by the user (no touches) for a long time. This is a feature of the system's behavior, and not a bug.
In some cases, disabling the adaptive brightness and proximity sensor in the screen settings helps, since their incorrect operation can erroneously signal to the system that the phone is in your pocket, which entails blocking background processes.
☑️ Background settings checklist
Frequently asked questions (FAQ)
Why does the application still close after rebooting the phone?
Most applications do not have the right to start automatically after a reboot without explicit permission. Go to the application settings and find the item Autostart (often found in the permissions section or in the manufacturer's proprietary security utility). Without this checkbox, the application will launch only after you open it manually.
Does constant operation of the application affect battery wear?
Yes, it does. If an application actively uses GPS, the Internet or the processor in the background, this leads to charge-discharge cycles and heat, which accelerates the degradation of battery chemistry. To minimize harm, try to limit background activity to only truly necessary services.
Is it possible to make an application work if it is not in the startup list?
If the manufacturer has strictly limited the startup list, you can only get around this using root access and special modules (for example, through Magisk) that replace system services. Without root access, the chances are slim, but sometimes installing an alternative launcher or using ADB commands to freeze system restrictions helps.
Why do settings reset themselves on Android 13-14?
Starting with Android 13, the system can automatically revoke permissions from applications that you have not used for several months. Check your settings: if an app has been in sleep mode for a long time, the system may have disabled its access to background data. Just open the application again and confirm the rights.
Is it safe to use ADB commands for configuration?
The commands given in the article (changing the timeout, checking Doze) are safe and reversible. However, you should not enter unfamiliar commands from the Internet without understanding their essence, as this can lead to unstable system operation or data loss. Always make a backup copy before experimenting.