This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Cherry-pick to release agua #10633
Merged
Merged
Cherry-pick to release agua #10633
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
853f824
[android] Enable map rendering when app is paused
ivovandongen e571277
[android] - activate filesource to list offline regions (#10531)
tobrun ab1b073
[android] - harden MarkerView integration by checking for null bitmap…
tobrun 05f0ba4
[android] - use concurrent lists for camera change listeners (#10542)
tobrun fbd451a
[android] - handle destroying activity programmatically as part of th…
tobrun 4e6a3ae
[android] - add FileSource activation/deactivation to MapSnapshotter,…
tobrun c331173
[core, ios, qt, android] Close race condition in RunLoop (issue #9620)
ChrisLoer 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 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 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 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 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 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 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 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 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 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 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 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.
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.
@tobrun Adding
CopyOnWriteArrayList
makes it thread-safe, but may result in a rare scenario when user unregisters the listener, yet still gets the callback. Do you think we should add synchronization?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.
I haven't ran into any issues with that or haven't heard about any reports. The reason why I don't perceive this as an issue is that the interactions with this list allows occurs on the main thread.
The reason why we have a CopyOnWriteArrayList is to allow to remove the listener as part of it's callback to avoid a
ConcurrentModificationException
. Imo your remark is a tradeoff of this, happy to look more into this if there is a use-case for it.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.
The problem arises when you'd like to register/unregister on a separate thread (which in my scenario would have thrown
ConcurrentModificationException
before and now will just execute the callback). Since your use-case is concrete and the problem was there before anyway, just in a different form, I think we're good here.Maybe adding
@UiThread
annotation when registering inMapboxMap
would be nice if we expect users to register/unregister on the main thread?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.
We annotate the class with
@UiThread
, which is the equivalent to adding the annotation to each method of the class. Would love to see if we can improve the implementation in future iterations ;)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.
Missed that, totally makes sense :)