-
-
Notifications
You must be signed in to change notification settings - Fork 452
fix(breadcrumbs): Unregister SystemEventsBroadcastReceiver when entering background #4338
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
Conversation
SentryLevel.INFO, | ||
"androidx.lifecycle is not available, AppLifecycleIntegration won't be installed", | ||
e); | ||
SentryLevel.WARNING, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR, but I just noticed while testing no androidx.lifecycle case that it's noisy and decided to change that
Performance metrics 🚀
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I left two small comments!
📜 Description
Some background
Android 14 introduced new behavior for broadcast receivers, and our SystemEvents receiver (used to add breadcrumbs like screen on/off, airplane mode change, etc.) is falling under this. What's happening is the process gets cached for some period of time (can be hours or days) and after getting uncached it receives all those pending broadcasts in a quick succession which most likely causes ANRs. This also correlates with the numbers we see in SDKCD where the biggest number of ANRs is coming from Android 14+.
I did some tests locally and it is indeed happening as described on the screenshot.
SystemEventsBreadcrumbsIntegration
is now lifecycle-aware:💡 Motivation and Context
Closes #4294
Internal customer case
💚 How did you test it?
Manually + automated
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps