-
-
Notifications
You must be signed in to change notification settings - Fork 459
perf(connectivity): Have only one NetworkCallback active at a time #4562
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2a0d6da
perf(connectivity): Cache network capabilities and status to reduce I…
romtsn 0ac3081
Merge branch 'main' into rz/perf/less-ipc
romtsn 14bb2d5
changelog
romtsn c82586d
Changelog
romtsn 7418781
revert
romtsn f739d00
fix(breadcrumbs): Deduplicate battery breadcrumbs
romtsn 833b026
ref
romtsn e4596ff
Changelog
romtsn 0153ab5
Fix test
romtsn 15794c6
Merge branch 'rz/perf/less-ipc' into rz/fix/diff-battery-crumbs
romtsn c31d648
perf(connectivity): Have only one NetworkCallback active at a time
romtsn 83d80d7
Changelog
romtsn d4d7816
Remove obsolete tests
romtsn aa6dd68
Merge branch 'main' into rz/perf/single-network-callback
romtsn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,9 @@ public void close() throws IOException { | |
@Override | ||
public void onConnectionStatusChanged( | ||
final @NotNull IConnectionStatusProvider.ConnectionStatus status) { | ||
if (scopes != null && options != null) { | ||
if (scopes != null | ||
&& options != null | ||
&& status != IConnectionStatusProvider.ConnectionStatus.DISCONNECTED) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kind of unrelated to this PR, but I noticed that we also submit a task even if the status was DISCONNECTED, which was unnecessary since we'd anyway bail out in the submitted task itself. |
||
sendCachedEnvelopes(scopes, options); | ||
} | ||
} | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
one caveat: This now will not emit AVAILABLE and CAPABILITIES_CHANGED callbacks immediately after registration as opposed to calling
ConnectivityManager.registerDefaultNetworkCallback
.But I think it's fine and how it should be - previously any event would always start with NETWORK_AVAILABLE breadcrumb, which could have been misleading, now we're actually adding breadcrumbs whenever there's a change.