SettingsProvider
Provider interface for Android Auto settings management.
This interface defines the contract for reading and updating navigation/routing settings from the Android Auto settings screen. It follows the same provider pattern used by SearchProvider, QuickAccessProvider, and GuidanceProvider.
Architecture
androidauto (interface) app (implementation)
┌───────────────────────┐ ┌───────────────────────────┐
│ SettingsProvider │◄────────│ SettingsProviderImpl │
│ - settingsState │ │ - GuidancePreferences │
│ - updateSetting() │ │ - RoutingPreferences │
│ - refresh() │ │ - TrafficPreferences │
│ - dispose() │ └───────────────────────────┘
│ - reinitialize() │ ▲
└───────────────────────┘ │
▲ AndroidAutoModule (DI)
│
android_auto (consumer)
┌──────────────────────────────┐
│ AndroidAutoSettingsScreen │
│ - observes settingsState │
│ - calls updateSetting() │
└──────────────────────────────┘Lifecycle
The provider is created as a singleton via Hilt DI and follows the standard AA provider lifecycle:
dispose(): Called when AA disconnects — cancels coroutines, resets state
reinitialize(): Called when AA reconnects — recreates scope, reloads preferences
Thread Safety
All settings reads/writes go through SharedPreferences which are thread-safe. State updates are performed atomically via StateFlow.
See also
Properties
Functions
Returns the list of custom setting keys with their display labels and current values.
Reinitializes the provider after disposal.
Updates a custom setting value defined by the client application.
Updates the Android Auto map's day/night mode, when the user changes it on the Android Auto settings screen.
Updates a single setting value and persists it to shared preferences.