Skip to content
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

Register system callbacks on background thread #1292

Merged
merged 2 commits into from
Jun 29, 2021
Merged

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Jun 24, 2021

Goal

Registers callbacks on a background thread to avoid unnecessary work in the Client constructor. This saves approximately ~10ms when calling Bugsnag.start().

Changeset

Registered the following on the background thread:

  • SystemBroadcastReceiver, which receives intents that are turned into breadcrumbs
  • Network connectivity changes
  • Orientation changes
  • Memory trim callbacks

Converted SystemBroadcastReceiver to kotlin while making changes. It's also worth noting that some methods are package visible to prevent the creation of synthetic accessors.

Testing

Relied on existing test coverage, and ran an example app to test orientation/connectivity/system broadcast changes

@fractalwrench fractalwrench force-pushed the offload-init-work branch 2 times, most recently from 1768edd to f61b285 Compare June 24, 2021 15:08
Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - With some minor suggestions

@fractalwrench fractalwrench force-pushed the offload-init-work branch 8 times, most recently from 3b759bb to b973581 Compare June 29, 2021 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants