Android’s battery optimization is designed to stretch every percent of charge, but the same feature can also cause apps to stop working in the background, miss notifications, or even crash. This guide explains the core mechanisms behind Android’s adaptive battery, how the system decides which apps to limit, and provides safe, step‑by‑step methods to manage exceptions – both through the UI and with ADB – without rooting your device.
Since Android 6.0 (Marshmallow) Google introduced Doze and App Standby. Their goal is simple: when the device is idle, keep the CPU and network asleep unless a high‑priority task needs attention. Starting with Android 9 (Pie), Adaptive Battery adds machine‑learning predictions to limit power‑hungry apps based on your usage patterns.
foreground, active, working_set, frequent, restricted) and throttles CPU/network for lower‑ranked buckets.These mechanisms are great for most users, but they can be frustrating when a messaging app stops delivering messages or a fitness tracker fails to log steps. Knowing how to view the current state and how to create exceptions is essential for a smooth experience.
Build number seven times).Android provides a quick visual overview of the battery‑optimization status for each installed app.
On devices with heavy OEM customizations (e.g., Samsung, Xiaomi), the path may differ slightly: Settings > Device care > Battery > App power management, or Settings > Battery > App launch.
This is the safest and most universal method. It works on all Android versions that support battery optimization (6.0+).
After you confirm, the system will no longer place the app into Doze or App Standby. The change takes effect immediately, but some apps may need a restart to recognize the new status.
If you have several apps to exempt (e.g., a messenger, a VPN, a health tracker), typing each one through the UI can be tedious. ADB lets you script the changes.
adb devices
You should see your device’s serial number listed as device.com.example.app with the actual package name):
adb shell cmd appops set com.example.app RUN_IN_BACKGROUND allow
adb shell cmd appops set com.example.app AUTO_REVOKE_PERMISSIONS ignore
The first line tells Android to let the app run background services; the second prevents the system from automatically revoking permissions for that app.whitelist.txt with one package name per line, then run:
while read pkg; do adb shell cmd appops set $pkg RUN_IN_BACKGROUND allow; done < whitelist.txt
Why this works: The appops command modifies the App Ops database, which sits underneath the battery‑optimization UI. It is a low‑level way to achieve the same result without navigating menus.
Adaptive Battery works at the bucket level, but you can move an app to a higher bucket by marking it as “Unrestricted”. This is done through the Settings > Battery > Battery usage screen.
This tells the system to treat the app as a foreground or active bucket, which effectively disables the throttling that Adaptive Battery would otherwise apply.
Many manufacturers ship their own power‑saving layers that sit on top of Android’s native optimization. They often have aggressive kill‑lists that ignore the standard whitelist.
When you encounter unexpected battery‑drain despite whitelisting, double‑check these OEM panels because they can override the standard Android settings.
POST_NOTIFICATIONS runtime permission.Permission denied for appopsadb shell dumpsys batterystats --checkin to see per‑app power consumption.Disabling Adaptive Battery (Settings > Battery > Adaptive Battery) is a blunt instrument that can improve performance for power‑hungry apps but will reduce overall battery life. Reserve this for devices with very large batteries (e.g., 5000 mAh+) or for users who prioritize constant background sync over endurance.
Android’s battery optimization is a layered system that balances power savings with app functionality. By understanding Doze, App Standby, and Adaptive Battery, you can make informed decisions about which apps truly need an exemption. The UI method is simple and safe for occasional tweaks; ADB gives you a fast, repeatable way to whitelist many apps at once; and OEM‑specific panels must be checked on heavily skinned devices. Follow the checklist, keep your whitelist tight, and you’ll enjoy reliable background behavior without sacrificing the battery life Android promises.









