-
-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using a more accurate ANR tracking implementation #1796
Comments
Thanks you for bringing this up. It makes sense and perhaps we should consider an approach for Android 11+ only and keep the current as-is. Additionally, there's the possibility of relying on |
I've tested the 3rd option 2y ago and it worked really well, indeed, https://github.com/marandaneto/android-exit-reasons-api-sample the new API returns a InputStream tho, so it requires us converting this info into a SentryEvent https://developer.android.com/reference/kotlin/android/app/ApplicationExitInfo#gettraceinputstream |
Let's use the new API for Android >= 11 and keep the watch dog approach for back compatibility. |
Update the docs after doing this, the docs should state the behavior for older and newer OS versions. |
For reference, that's how Android itself does it https://cs.android.com/android/platform/superproject/+/master:frameworks/base/services/core/java/com/android/server/am/AnrHelper.java Check if this https://developer.android.com/reference/android/os/health/ProcessHealthStats helps with something as well |
The current Example:
We could have a |
Hi, i'm currently evaluating Bugsnag and Sentry and one of the differences i've observed in the SDK is that Bugsnag uses a SIGQUIT signal handler to get called by OS when ANR occurs, as opposed to Sentry, which uses the watchdog approach.
I have used https://github.com/SalomonBrys/ANR-WatchDog in production before and while it's a useful library, I saw that it reports many false-positives compared to Play Console, especially in case of ANRs in BroadcastReceivers.
SIGQUIT approach is also not perfect, though. It doesn't track background ANRs: bugsnag/bugsnag-android#1377
There's a third approach to track ANRs and Crashlytics' Alpha version seems to be using it (tracks both foreground and background ANRs): getHistoricalProcessExitReasons on Android 11 and above only, sadly.
Any thoughts?
The text was updated successfully, but these errors were encountered: