跪拜 Guibai
← All articles
Android · Performance Optimization

One App, Five ROMs, Five Ways to Die: 8 Real Android Compatibility Traps from a Chinese Health Team

By 疯华整猫 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

These failure modes cost Chinese Android apps daily users, store rejections, and hours of debugging that never reproduce on a test device. The team's concrete detection and architecture patterns—ROM detection via system properties, deferred SDK init, and a known-issues runbook—translate directly to any team serving the domestic Chinese market, where GMS is absent and vendor behavior trumps platform documentation.

Summary

A health app project in China documents eight distinct ways domestic Android ROMs break otherwise working apps. The starting point is a null pointer that crashed on five latest flagship phones after each vendor pushed a system update; the root cause turned out to be a changed ContentProvider initialization order. From there the piece expands into a systematic catalog: background processes killed with no callback on five different lifespan policies, push channels that silently drop messages without vendor SDKs, overlay permissions that pass system checks but still fail at runtime, WebView kernels that drift independently of OS version, privacy compliance failures triggered by third-party SDK initialization before user consent, five app stores with different and contradictory review requirements, broadcast interception that breaks sync features, and new cracks from foldables and Android 16.

The team's response is less about fighting vendors and more about designing for failure. They built a ROM detection layer based on system properties, a device matrix that includes HarmonyOS NEXT as a separate target, a known-issues document that turns every incident into a runnable check, and a self-check script that reports permission states at startup. Their core claim is that compatibility cost lives in discovery and memory, not in fixing: a known issue takes minutes to resolve, but finding it the first time can take days. The final stack is a set of reusable patterns—unified push adapters, a PrivacyGate for SDK initialization, a compatibility matrix, and crash attribution by ROM type and targetSdk version—that any team shipping to the Chinese market can adapt.

Takeaways
— Five vendors' new ROMs changed ContentProvider initialization order, causing the same null pointer on Huawei, Xiaomi, OPPO, vivo, and Honor simultaneously.
— Background process survival times without user whitelisting: Xiaomi 30s–3min, Huawei/Honor 1–2min, OPPO 1–3min, vivo variable, native Android hours; none of the vendors provide a kill callback.
— User guidance pages for whitelisting have a 3%–7% conversion rate, and the system can reset settings later.
— A dual-process keep-alive daemon measured 11%–14% extra battery drain over 24 hours on a Xiaomi device and can break after any system update.
— Third-party push channels deliver only 30%–60% on domestic ROMs; connecting all five vendor channels pushes that above 90%.
— FCM is unreachable from servers inside mainland China, so Firebase-based global push fails domestically.
— Overlay permissions require three gates: system canDrawOverlays, a vendor-specific secondary toggle, and an actual runtime addView test; MIUI blocks addView if the user swiped the app away even with permission granted.
— Android System WebView is a separate APK updated through the app store, so the same OS version can have Chromium 115 to 130, and behavior changes without any app release.
— Login state stored in cookies breaks on modern WebView versions due to third-party cookie policies; the team moved to a token in localStorage or native storage.
— Huawei's automated privacy review scans the entire process lifecycle, so any device-info read or network request before the user taps "Agree"—including from third-party SDK initialization—counts as a violation.
— 67% of the team's 2025 app store rejections were material issues like name mismatches or missing documents, not strict review decisions.
— BOOT_COMPLETED broadcasts can be blocked by vendor self-start whitelists; fallback to app-start catch-up sync and vendor push messages.
— Targeting Android 16 makes edge-to-edge and predictive back mandatory, narrows the SYSTEM_ALERT_WINDOW exemption for background foreground-service starts, and imposes runtime quotas on background jobs.
— The real-device matrix treats Huawei HarmonyOS NEXT and the Android compatibility layer as two separate test targets, and includes a low-end device with an un-updated WebView.
— Crash attribution by ROM type and targetSdk version, not just model name, is needed to distinguish vendor issues from app issues.
Conclusions

The same null pointer appearing on five vendors simultaneously shows that third-party SDKs assuming a standard initialization order are a systemic risk, not a one-vendor quirk.

Vendor battery management is designed to protect benchmark scores and user perception of battery life, so working against it with keep-alive tricks is a losing game; the only sustainable path is user-granted permission plus architecture that survives death.

The shift from "process alive" to "dead but recoverable" is the real lesson; the cost is not in writing recovery code, but in discovering the failure modes and remembering them, which the KNOWN_ISSUES.md makes systematic.

Treating store rejections as predictable rather than avoidable reframes the problem: material errors can be eliminated with templates and checklists, while privacy issues often hide inside third-party SDKs beyond your control.

The WebView drift—kernel version decoupled from OS version—means feature detection at runtime is the only sane policy, and core business flows should avoid H5 entirely.

Concepts & terms
Vendor push channel
A push delivery service operated by the phone manufacturer (Huawei HMS, Xiaomi MiPush, etc.) where messages are delivered by the system process, independent of whether your app is running. Contrast with third-party push that relies on your own app's long-lived TCP connection.
ROM compatibility matrix
A living document that records, per vendor ROM, which system behaviors (background service, push, overlay, broadcasts) are allowed or blocked, and what steps are needed to obtain permission. It turns vendor quirks into a predictable checklist.
PrivacyGate
A pattern where all third-party SDK initialization is deferred until the user explicitly accepts the privacy policy. The app's Application.onCreate starts only basic infrastructure, so no device info is collected or sent before consent.
Known-issues runbook
An internal markdown file (KNOWN_ISSUES.md) that records every mysterious vendor behavior with symptom, root cause, and verification method. It converts hard-won debugging knowledge into a 10-minute lookup for future incidents.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗