Keep Background Services Alive on Android (by Brand)
Jump to navigation
Jump to search
Keep Background Services Alive on Android: Battery Optimization Fixes by Brand
Many Android phone manufacturers implement aggressive battery optimization policies that kill background services, even foreground ones. This behavior breaks apps that rely on persistent background functionality (like GPS tracking, health monitoring, or messaging).
Below are device-specific instructions to help users configure their phones properly and keep background services alive.
General Recommendations
- Ensure the app uses a Foreground Service with a persistent notification
- Ask the user to disable battery optimizations
- Detect the device brand programmatically (`Build.MANUFACTURER`) and show brand-specific help
- Optionally link to dontkillmyapp.com
Xiaomi / Redmi / Poco (MIUI)
MIUI is known for aggressively killing background services.
Steps to allow background operation:
- Go to Settings > Battery
- Tap on Battery saver
- Tap on Battery saver for apps (or App battery saver)
- Find your app and set it to No restrictions
- Go to Settings > Apps > Manage apps
- Tap your app and enable Autostart
- Open the recent apps screen, swipe down your app and tap the lock icon 🔒 to prevent it from being cleared
Huawei / Honor (EMUI)
EMUI kills background tasks aggressively, even for foreground services.
Steps to fix:
- Go to Settings > Battery
- Tap App launch
- Disable Manage all automatically
- Manually enable Auto-launch, Secondary launch, and Run in background for your app
Samsung (One UI)
Samsung is more moderate but still applies background restrictions.
Steps:
- Go to Settings > Battery and device care > Battery
- Tap Background usage limits
- Tap Never sleeping apps
- Add your app to the list
- Optional: Go to Settings > Apps > your app > Battery and choose Unrestricted
OnePlus (OxygenOS)
OnePlus uses aggressive RAM and battery management.
Steps:
- Go to Settings > Battery
- Tap Battery optimization
- Set your app to Don't optimize
- Go to Settings > Apps & notifications > Special app access > Battery optimization
- Again, set your app to Don't optimize
Oppo / Realme (ColorOS)
ColorOS kills background processes aggressively.
Steps:
- Go to Settings > Battery
- Tap App battery management
- Find your app and select Allow background activity
- Also check Settings > App management > your app > Battery usage
- Set it to Unlimited
Vivo
Vivo applies similar background limits.
Steps:
- Go to Settings > Battery
- Tap on High background power consumption
- Find your app and enable it
- Go to Settings > App manager > your app
- Enable Allow background activity
External Resources
- dontkillmyapp.com — Community-maintained guide on battery restrictions