Animation Thread Controller
Experimental controller singleton allowing to use background thread for all Mapbox animations. Most likely should not be used directly, calling useBackgroundThread should do all the work.
By default all Mapbox animations are running on Android Main thread.
Following Mapbox plugins are updated to make use of background animation thread:
plugin-locationcomponent
plugin-animation
plugin-viewport
Switching between useBackgroundThread and useMainThread could be done at any point in runtime.
Using this class is extremely unsafe and error prone, it should be used in very specific use-cases! Even when it's essential to use it (for example Android Auto use-case on specific devices when locking the device) it would be safer to use Android Main thread as much as possible and switch to background thread only when it's needed.
Functions
Execute function on animator thread.
Execute function on Android Main thread.
Spawn new animation HandlerThread that will be used for all Mapbox animators. If animation thread is already running - function is no-op.
If useBackgroundThread was called beforehand - kill background animator thread and use Android Main thread for all Mapbox animators. Otherwise function is no-op.