-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Fix BroadcastReceivers #4052
Merged
Merged
Fix BroadcastReceivers #4052
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Performance metrics 🚀
|
stefanosiano
approved these changes
Jan 16, 2025
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.
Nice!
Co-authored-by: Stefano <stefano.siano@sentry.io>
Co-authored-by: Stefano <stefano.siano@sentry.io>
markushi
pushed a commit
that referenced
this pull request
Jan 28, 2025
* Drop TempSesnorBreadcrumbIntegration * Drop PhoneStateBreadcrumbsIntegration * Reduce number of system events we're listening to and use RECEIVER_NOT_EXPORTED * Format code * Changelog * Update CHANGELOG.md Co-authored-by: Stefano <stefano.siano@sentry.io> * Update CHANGELOG.md Co-authored-by: Stefano <stefano.siano@sentry.io> --------- Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io> Co-authored-by: Stefano <stefano.siano@sentry.io>
markushi
added a commit
that referenced
this pull request
Jan 30, 2025
* Various fixes to instrumentations running on the main thread (#4051) * Get rid of redundant requireNonNull * Do not instrument Window.Callback multiple times * Do not instrument FileIO if tracing is disabled * Do not traverse children if a touch event is not within view groups bounds * Add test for SentryFileOutputStream * Fix test * Fix test * Changelog * pr id * Fix api dump * Fix BroadcastReceivers (#4052) * Drop TempSesnorBreadcrumbIntegration * Drop PhoneStateBreadcrumbsIntegration * Reduce number of system events we're listening to and use RECEIVER_NOT_EXPORTED * Format code * Changelog * Update CHANGELOG.md Co-authored-by: Stefano <stefano.siano@sentry.io> * Update CHANGELOG.md Co-authored-by: Stefano <stefano.siano@sentry.io> --------- Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io> Co-authored-by: Stefano <stefano.siano@sentry.io> * Only provide {{auto}} ip-address if sendDefaultPii is enabled * Update changelog * Reduce the number of IPC calls (#4058) * Remove binder call for external storage * Remove binder call for memory in profiler * Cache static values to avoid binder calls * Comment * Changelog * Formatting * Fix tests * Minor fixes * change protected method in final class to private --------- Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io> Co-authored-by: stefanosiano <stefano.siano@sentry.io> * Update Changelog * Fix tests --------- Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com> Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io> Co-authored-by: Stefano <stefano.siano@sentry.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📜 Description
TempSensor
andPhoneState
breadcrumbs integrations, as those don't seem to be very useful and potentially register for too many broadcasts that sometimes cannot be delivered. We plan to introduce a new integration that would listen to the ThermalState changes instead.SystemEvents
breadcrumbs integration. Some of those seem to be not helpful, but there are some that are sketchy, like ACTION_REBOOT (only for use of system apps) or ACTION_POWER_CONNECTED (which will wake the app up)RECEIVER_NOT_EXPORTED
. If you check the ContextCompat docs, it says RECEIVER_NOT_EXPORTED is enough to receive broadcasts from the system. I tested it locally with a script that runs over the actions we're subscribed for and send them viaadb shell
on API 33, and it worked fine with NOT_EXPORTED.The event with all of the broadcast breadcrumbs that we listen to now can be found here: https://sentry-sdks.sentry.io/issues/5990712373/events/dc048d7441d7496f99f09b1c38c56f7e/
💡 Motivation and Context
Closes #2395
Closes #1774
Internal customer reports. Looks like when we're registered for too many broadcasts, the OS will kill the app process silently if it can't deliver a broadcast, so we're trying to reduce the likelihood of that by reducing the number of broadcasts we're listening to, just keeping the essential ones.
See here: https://cs.android.com/android/platform/superproject/+/android14-qpr3-release:frameworks/base/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java;l=1166-1167?q=broadcastqueuemod
💚 How did you test it?
Manually (on API 33+) and automated
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps
We may need to add docs around SystemEventsIntegration to show off how to add more actions. For now I'm mentioning it in the changelog