Briefing

Honor Android Battery Optimization Whitelist Policy Revealed

security
by Stoyan Minchev ·

Check how your app queries PowerManager.isIgnoringBatteryOptimizations() in background vs foreground; adjust logic to account for vendor-specific enforcement bit.

What to do now

Patch your code to detect background context and treat isIgnoringBatteryOptimizations() as true when in background, or request whitelist again; test on Honor devices.

Summary

An Android app that monitors elderly users relies on PowerManager.isIgnoringBatteryOptimizations() to stay whitelisted. On Honor devices running MagicOS 9.0, the app was added to the whitelist during install, yet background watchdog checks reported the app as not whitelisted, triggering degraded health logs.

The discrepancy was caused by Honor's PowerGenie layer, which adds an enforcement bit to the API response only for background processes based on a per‑UID trust score. While foreground checks returned true, background checks returned false even though the AOSP whitelist remained unchanged. The issue manifested as false degraded health states and unnecessary recovery screens. The behavior is a vendor policy, not a race condition, and is likely present on other OEMs. Developers must account for differing return values depending on process context to avoid false positives.

Key changes

  • Honor's PowerGenie adds an enforcement bit to isIgnoringBatteryOptimizations() only for background processes
  • Background checks return false while foreground returns true even though the AOSP whitelist remains unchanged
  • PowerGenie uses a per‑UID trust score to decide enforcement
  • The issue caused false degraded health logs and recovery screens
  • The behavior is a vendor policy, not a race condition
  • The AOSP whitelist remains unchanged; dumpsys shows true
  • The app must handle differing return values based on process context
  • Developers should detect background context and treat isIgnoringBatteryOptimizations() as true when in background

Affects

internal

Customer impact

Analyzing matches…

Ask about this story

Impact on an agency? Which customers? Compare historically Risks of waiting