AndroidAutoScreenState
Represents which screen is currently active on Android Auto.
This enum is used to communicate the AA screen state to the phone app, allowing it to show context-appropriate UI. The phone app observes this state via AndroidAutoSurfaceManager.aaScreenState StateFlow.
State Transitions
DISCONNECTED ──→ MAP_VIEW (AA session created, main screen shown)
│
├──→ SEARCH (user opens search)
│ │
│ └──→ ROUTE_PREVIEW (destination selected)
│ │
│ └──→ NAVIGATION (guidance started)
│
├──→ NAVIGATION (quick start from favorites)
│
└──→ SETTINGS (user opens settings)Content copied to clipboard
Usage
Each AA screen reports its state when it becomes active:
// In AndroidAutoMainScreen
init {
AndroidAutoSurfaceManager.setAAScreenState(AndroidAutoScreenState.MAP_VIEW)
}Content copied to clipboard
Phone app observes and updates UI accordingly:
val aaScreenState by viewModel.aaScreenState.collectAsState()
when (aaScreenState) {
DISCONNECTED -> MainMapViewComposable()
MAP_VIEW -> AAPhoneMapViewScreen()
SEARCH -> AAPhoneMapViewScreen() // Search is independent
// ...
}Content copied to clipboard
See also
AndroidAutoSurfaceManager
Entries
Properties
Functions
Link copied to clipboard
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Link copied to clipboard
Returns an array containing the constants of this enum type, in the order they're declared.