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)

Usage

Each AA screen reports its state when it becomes active:

// In AndroidAutoMainScreen
init {
AndroidAutoSurfaceManager.setAAScreenState(AndroidAutoScreenState.MAP_VIEW)
}

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
// ...
}

See also

Entries

Link copied to clipboard

Android Auto is not connected or the app is not open on AA.

Link copied to clipboard

AA is showing the main map screen (NavigationTemplate).

Link copied to clipboard

AA is showing the search screen (SearchTemplate).

Link copied to clipboard

AA is showing the route preview screen (MapWithContentTemplate).

Link copied to clipboard

AA is in active navigation mode (future).

Link copied to clipboard

AA is showing the settings screen (ListTemplate with toggles).

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

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.