Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Camera Callbacks Not Returning On Main UI Thread #5810

Closed
bleege opened this issue Jul 27, 2016 · 6 comments
Closed

Camera Callbacks Not Returning On Main UI Thread #5810

bleege opened this issue Jul 27, 2016 · 6 comments
Labels
Android Mapbox Maps SDK for Android bug

Comments

@bleege
Copy link
Contributor

bleege commented Jul 27, 2016

MapboxMap.animateCamera() and MapboxMap.easeCamera() are firing their Callbacks on the Map Thread and not the main UI Thread as the JavaDocs comments say.

@ivovandongen
Copy link
Contributor

@bleege What is the actual error you got? I've been testing this recently and in my tests the callbacks do actually return on the main thread, but I think there is another issue going on: #5721

@ivovandongen
Copy link
Contributor

@bleege Or might it be this bug you ran into #5836. I've created an activity to reproduce it, but the callbacks are always triggered on the main thread for me.

07-30 15:53:43.106 28555-28555/com.mapbox.mapboxsdk.testapp I/CameraAnimationChainingActivity: UI Thread id: 1, name main
...
07-30 15:54:05.726 28555-28555/com.mapbox.mapboxsdk.testapp I/CameraAnimationChainingActivity: Duration onFinish Callback called on Thread id: 1, name main

@bleege
Copy link
Contributor Author

bleege commented Aug 1, 2016

@ivovandongen Yep, this is an "error" that doesn't always occur. The background on this issue is that it was reported to us by a customer as impacting their development because they didn't feel they could rely on it always returning on the main UI Thread. They haven't communicated that they were experiencing the issues in #5721 or #5836 so the work that @incanus did on this in 3561783 might be enough to resolve this. Regardless, if what you've found is that those issues are the true root of this problem then we should definitely include their progress to track how done this bug is. Let's pick up the conversation from #5834 tomorrow with @incanus and go from there. 👍

@ivovandongen
Copy link
Contributor

@bleege I'd love some more information about their actual issue then. But, by posting the callback on the main looper we might introduce more subtle issues as we can't rely on the the state being in sync anymore. That's my main worry.

@incanus
Copy link
Contributor

incanus commented Aug 1, 2016

I wondered about state as well.

@bleege
Copy link
Contributor Author

bleege commented Aug 1, 2016

Capturing voice chat with @ivovandongen @incanus this morning on this topic. @ivovandongen said that during his research he was able to confirm that this issue was in existence in 4.0.0 but that it has been addressed as part of threading refactorings in Core GL since then. In other words this is fixed in master. The plan going forward is to address the related issues in #5721 and #5836 for the next release (currently 4.2.0) as that will close the loop on this in it's entirely.

@bleege bleege closed this as completed Aug 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android bug
Projects
None yet
Development

No branches or pull requests

3 participants