Skip to main content
Many Android manufacturers implement aggressive battery optimization features on top of standard Android power management. These OEM-specific restrictions can kill background apps even when the app is exempt from standard Android battery optimizations.

The OEM battery optimization problem

While Android provides system-level battery optimizations (Doze mode and App Standby), manufacturers like Xiaomi, Huawei, Samsung, Oppo, and Vivo add their own battery management layers with additional restrictions.

Why standard exemptions aren’t enough

You can be fully exempt from Android’s battery optimizations but still get killed by OEM restrictions:
Critical insight: Standard Android battery optimization exemptions only affect Google’s power management. They do not override manufacturer-specific battery savers, app killers, or autostart managers.

Manufacturer-specific implementations

Each manufacturer implements their own battery optimization system with different settings and behaviors:

Xiaomi (MIUI)

Features:
  • Autostart Manager - Controls which apps can start in the background
  • Battery Saver - Aggressive app killing when screen is off
  • App Battery Saver - Per-app power restrictions
Settings locations:
  • Security → Permissions → Autostart
  • Battery & Performance → App Battery Saver
  • Settings → Apps → Manage Apps → [Your App] → Battery Saver → No Restrictions
MIUI implementation detail: The library attempts to open these activities:
  1. com.miui.securitycenter/com.miui.permcenter.autostart.AutoStartManagementActivity
  2. com.miui.securitycenter/com.miui.powercenter.PowerSettings
These are defined in BackgroundGuardianModule.kt:468-480.

Huawei / Honor (EMUI / Magic UI)

Features:
  • Startup Manager - Controls background app launches
  • Protected Apps - Apps that won’t be killed when screen is off
  • Battery Optimization - Per-app power management
Settings locations:
  • Phone Manager → Startup Manager
  • Settings → Apps → [Your App] → Battery → App Launch (set to Manual)
  • Phone Manager → Protected Apps
EMUI implementation detail: The library tries these activities:
  1. com.huawei.systemmanager/com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity
  2. com.huawei.systemmanager/com.huawei.systemmanager.optimize.process.ProtectActivity
  3. com.huawei.systemmanager/com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity
From BackgroundGuardianModule.kt:484-502.

Samsung (OneUI)

Features:
  • Sleeping Apps - Apps put to sleep when not used
  • Deep Sleeping Apps - Aggressive background restriction
  • Battery Optimization - Per-app power settings
Settings locations:
  • Settings → Battery → Background Usage Limits → Never Sleeping Apps
  • Settings → Apps → [Your App] → Battery → Optimize Battery Usage → All Apps → Disable
OneUI implementation detail: The library tries:
  1. com.samsung.android.lool/com.samsung.android.sm.ui.battery.BatteryActivity
  2. com.samsung.android.sm/com.samsung.android.sm.ui.battery.BatteryActivity
From BackgroundGuardianModule.kt:560-572.

Oppo / Realme (ColorOS / Realme UI)

Features:
  • Startup Manager - Background app launch control
  • Battery Optimization - Aggressive power management
  • App Freeze - Suspends unused apps
Settings locations:
  • Settings → Privacy → Permission Manager → Startup Manager
  • Settings → Battery → Power Saving Options (disable)
  • Settings → Apps → [Your App] → Battery → Allow Background Activity

Vivo (FuntouchOS / OriginOS)

Features:
  • Background Running Apps - Whitelist for background execution
  • High Background Power Consumption - App power monitoring
  • Autostart - Control app launches
Settings locations:
  • Settings → Battery → Background Power Consumption Management → High Background Power Consumption
  • Settings → More Settings → Applications → Autostart
  • iManager → App Manager → Background Running Apps

OnePlus (OxygenOS)

Features:
  • Advanced Optimization - Background app restrictions
  • Battery Optimization - Per-app power settings
Settings locations:
  • Settings → Apps → [Your App] → Battery → Battery Optimization → Don’t Optimize
  • Settings → Battery → Battery Optimization → Advanced Optimization (disable)

Other manufacturers

The library also supports:
  • Asus (ZenUI) - Autostart Manager and mobile manager
  • Lenovo - Pure Background feature
  • Meizu (Flyme) - Power app permissions
  • Nokia (HMD Global) - Power saving exceptions

Complete OEM compatibility table

Here’s a comprehensive list of supported manufacturers and their OEM settings availability: Fallback behavior: For manufacturers without specific OEM settings, the library falls back to:
  1. Standard battery optimization settings list
  2. App details settings page

Opening OEM settings

The openOEMSettings() method automatically detects the device manufacturer and opens the appropriate settings:

How it works internally

The library maintains a map of OEM-specific intents for each manufacturer:
When you call openOEMSettings():
  1. It detects the manufacturer using Build.MANUFACTURER
  2. Looks up the manufacturer in the oemSettingsIntents map
  3. Tries each intent in order until one succeeds
  4. Falls back to standard battery optimization settings if no OEM settings work
  5. Final fallback to app details settings
OEM settings activities may not exist on all device variants or OS versions. The library tries multiple known activities per manufacturer and handles failures gracefully.

Fallback behavior

When OEM-specific settings aren’t available or fail to open, the library automatically falls back:

Fallback level 1: Battery optimization settings

Opens ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS - the standard Android battery optimization list.

Fallback level 2: App details

Opens ACTION_APPLICATION_DETAILS_SETTINGS - the app’s details page where users can access permissions and other settings.

Complete setup flow for OEM devices

Here’s a comprehensive implementation that handles OEM restrictions alongside standard Android battery optimizations:

User experience best practices

1. Progressive disclosure

Don’t overwhelm users with all settings at once. Start with standard Android exemptions, then guide to OEM settings only if needed:

2. Visual setup guides

For manufacturers with complex settings, consider providing visual guides:

3. Setup verification

Since there’s no programmatic way to check OEM settings status, use user confirmation:

4. Persistent reminders

For apps that critically depend on background execution, gently remind users:

Testing on different OEMs

Testing OEM restrictions requires physical devices from each manufacturer:

Testing checklist

For each OEM device:
  1. Install app without any exemptions
    • Verify background tasks are killed
    • Check logs for termination
  2. Grant standard Android exemption only
    • Verify if background tasks still get killed
    • Document behavior
  3. Open OEM settings
    • Verify correct settings page opens
    • Grant all necessary permissions
  4. Test background reliability
    • Lock screen for 5+ minutes
    • Verify background tasks continue
    • Check system logs for kills
  5. Test after reboot
    • Restart device
    • Verify autostart works
    • Check if settings persist

Debugging OEM issues

Use ADB to monitor app lifecycle:

Limitations

1. No programmatic detection

There’s no Android API to check OEM-specific settings status:

2. Activities may not exist

OEM settings activities vary by:
  • Device model
  • OS version
  • Region
  • Carrier customization
The library tries multiple known activities but may fail on some variants.

3. Settings locations change

Manufacturers frequently reorganize settings between OS versions. The library includes multiple fallback activities per manufacturer, but some devices may require manual navigation.

4. User confusion

OEM settings interfaces are often complex and poorly translated, leading to user confusion. Provide clear visual guides or video tutorials for critical apps.