setPhoneState

Sets the current phone app state.

Called by phone app (MainActivity, QrCodeScreen, OnboardingNavigation, MainViewModel) to update the state. Android Auto observes this via phoneState StateFlow.

Loading State Management

This method only triggers AndroidAutoLoadingState.ONBOARDING_REQUIRED when the phone reports PhoneAppState.ONBOARDING. This ensures the correct title screen message is displayed immediately when AA connects, without waiting for the Session's phoneState observer to run.

All other loading state transitions (INITIALIZING_MAPS, MAP_READY) are managed exclusively by the Session's phoneState observer, which handles the phone state → loading state mapping and deferred surface allocation.

Parameters

state

The new phone app state