Move start call of unused services off the main thread#2127
Merged
Conversation
jkasten2
requested changes
Jun 18, 2024
jkasten2
reviewed
Jun 18, 2024
a5e935f to
f2559c3
Compare
jkasten2
requested changes
Jun 24, 2024
jkasten2
left a comment
Member
There was a problem hiding this comment.
Left another 2 comments.
Also this existing comment is still unanswered and not addressed:
https://github.com/OneSignal/OneSignal-Android-SDK/pull/2127/files#r1644805601
jkasten2
reviewed
Jun 24, 2024
8f95d63 to
5469f76
Compare
jkasten2
requested changes
Jun 25, 2024
jkasten2
requested changes
Jun 25, 2024
jkasten2
left a comment
Member
There was a problem hiding this comment.
Tests are failing on CI, made a comment about one test that will not pass often.
jkasten2
approved these changes
Jun 25, 2024
jkasten2
left a comment
Member
There was a problem hiding this comment.
Changes look good now, but probably want to rebase to clean up a few a few of the fixup commits.
…ice start in background
afdfdc4 to
1346a32
Compare
jkasten2
approved these changes
Jun 25, 2024
Merged
18 tasks
jinliu9508
added a commit
that referenced
this pull request
Jul 3, 2024
Revert "Merge pull request #2127 from OneSignal/get-service-by-getter"
This file contains hidden or 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
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
One Line Summary
Move start call of unused services off the main thread to make the initWithContext more efficient.
Details
Motivation
Our SDK initialization is currently taking longer to finish compare to some other SDKs. One of the reason is we construct service components like Location Manager or IAM Manager during the initialization phrase when they are not really needed until later. This PR aims to move the initialization of these services to background thread so they don't slow down the overall SDK initialization.
Scope
The retrieval of services that were changed to initialize in background is not longer from a saved instance in OneSignalImp.kt. Instead, each of these components has a getter that retrieve its instance from the service provider.
Testing
Manual testing
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is