Closed kmadsen closed 2 years ago
Calling these functions one after another will not update the state to active guidance. Need a way to pause before addListener
navigationView.api.startActiveGuidance()
navigationView.addListener(appListener)
2022-09-16 17:27:47.166 onAttached CarAppSyncComponent
2022-09-16 17:27:47.167 onAttached car
2022-09-16 17:28:23.388 onAttached app
2022-09-16 17:28:23.388 navigationView.api.startActiveGuidance()
2022-09-16 17:28:23.389 updateCarAppState onFreeDrive
val routes = MapboxNavigationApp.current()!!.getNavigationRoutes()
navigationView.api.startActiveGuidance(routes)
navigationView.addListener(appListener)
Synchronization doesn't work for me in the following scenario:
Synchronization doesn't work for me in the following scenario:
Launch the app on a phone and start a trip. Launch Android Auto app. I expect that Android Auto app will immediately transition to Active Navigation state, but instead the trip is canceled.
Yeah nice catch. Not sure why the NavigationView is emitting that it is in free drive 👀
private val appListener = object : NavigationViewListener() {
override fun onFreeDrive() {
logI(LOG_TAG, "updateCarAppState onFreeDrive")
MapboxCarApp.updateCarAppState(FreeDriveState)
}
EDIT: Ok found it, it's in the MainCarSession
example. When enabling the trip session
Ok Replay is not supported yet to share between dropin and AA. We'll need a public api for that feature as well
Actually, synchronization doesn't work in a much simpler scenario:
Thanks for finding! A big issue to supporting this logic in the example is there are no unit tests to keep track of these issues
Testing this out because there are new functions available to sync NavigationView with MapboxCarApp