reinitialize

abstract fun reinitialize()

Reinitializes the provider after disposal.

This method recreates the coroutine scope and restarts the favorites collector. It should be called when Android Auto reconnects after a previous disconnection.

The provider is designed as a singleton (Hilt @Singleton), so instead of creating a new instance on reconnection, we reinitialize the existing one.

Lifecycle Pattern

AA connects (first time)  → init block runs automatically
AA disconnects → dispose() called
AA reconnects → reinitialize() called
AA disconnects again → dispose() called
...

See also