AANavigationCoordinator
Coordinator managing Android Auto screen navigation using a state machine.
This class serves as the single point of control for all screen navigation in Android Auto. It uses AANavigationStateMachine to validate transitions before executing them, ensuring the screen stack remains consistent with the navigation state.
Screen instantiation is delegated to AAScreenFactory, allowing each app to provide its own screen implementations without the SDK knowing about concrete screen types.
Responsibilities
Validate Navigation: Uses state machine to check if a navigation is valid
Execute Navigation: Performs the actual screen push/pop via ScreenManager
Coordinate Callbacks: Notifies phone app of relevant state changes
Provide State: Exposes current state for UI updates
Usage
val factory = MyScreenFactory()
val coordinator = AANavigationCoordinator(carContext, factory)
coordinator.openSearch() // Validates and pushes SearchScreen
coordinator.selectDestination("Paris") // Validates and pushes RoutePreviewScreen
coordinator.startNavigation("Paris", false) // Validates and pushes NavigationScreenParameters
The CarContext from the Android Auto session
Factory for creating app-specific screen instances
Additional state machine transitions for custom screens. Merged with built-in defaults. See AANavigationStateMachine for details.
See also
Constructors
Functions
Cancels route preview and returns to map view.
Gets the list of valid actions from the current state.
Navigates to a custom screen using a custom action.
Called when Android Auto connects.
Called when Android Auto disconnects.
Opens the search screen from MapView.
Forces the state machine to a specific state without screen changes.
Selects a destination and opens route preview.
Starts navigation from route preview.
Stops navigation and returns to map view.
Synchronizes the navigation state to match the phone's equivalent state.