How the Android Framework Monitors, Processes, and Triggers ANRs
summary
Android’s framework starts a watchdog whenever work is scheduled and writes a trace to /data/anr via ANRHelper → ProcessRecord → AppErrors when thresholds are exceeded: activity input dispatch at 5 seconds input threshold, broadcast receivers at 10s, services at 10s/20s/200s depending on type, and content providers if you don’t return mime type within getProviderMimeType 1s (use the async variant). Firebase Crashlytics uses ApplicationExitInfo (Android 11+), Play Console uses on-device trace files, ANRs are discarded with a debugger attached or if a process is exiting, and Google counts bad behavior against a 0.47% Play Console threshold.
AI-written summary · about
chapters (9)
- 0:00Introduction to ANRs
- 3:38Current ANR data limitations
- 9:40How ANRs are triggered
- 16:04Content provider ANRs
- 17:07Component overload and ANRs
- 19:36Android framework ANR collection
- 22:49Better ANR debugging approaches
- 27:02Key takeaways and summary
- 28:49Q&A and closing
related talks
29mHow the Android Framework Monitors, Processes, and Triggers ANRs
19mRevolutionizing ANR Detection at Sentry
39mWhere Is Your ANR Coming From? — Diagnosing How It Occurs and Prescribing Remedies by Symptom
22mANR overview at Uber + Leveraging ApplicationExitInfo API
29mWhy ANRs are Hard to Solve and What You Can Do to Make it Easier
12mUnderstanding and debugging ANR's (Android Not Responding)
22mEverything you ever wanted to know about error handling in Android
53mCheck your app's vitals
