AppModule

@Module
object AppModule

Provides bindings specific to the mvvm-with-a-service demo. The core Shuttle infrastructure graph (DAO, warehouse, facade, Shuttle) is provided by ShuttleCoreModule in :demos-core-foundation. This module supplies the Room config (with multi-process enabled for IPC), service connection factory, visibility observable, and the remote service configuration.

Functions

Link copied to clipboard
@Named(value = "MainScope")
@Provides
fun provideMainScope(): CoroutineScope

Provides a kotlinx.coroutines.CoroutineScope tied to the main dispatcher.

Link copied to clipboard
@Provides
@Named(value = "RemoteServiceConfig")
fun provideRemoteServiceConfig(shuttle: Shuttle, errorObservable: ShuttleVisibilityObservable): ShuttleServiceConfig

Provides the ShuttleServiceConfig for com.grarcht.shuttle.demo.mvvmwithaservice.model.RemoteService, configured for IPC messenger binding with automatic rebind on unbind.

Link copied to clipboard
@Provides
@Singleton
fun provideShuttleRoomDbConfig(context: Context): ShuttleRoomDbConfig

Provides the ShuttleRoomDbConfig with multi-process mode enabled so the Room database is accessible from both the main process and the remote service process.

Link copied to clipboard
@Provides
fun provideShuttleServiceConnectionFactory(): ShuttleServiceConnectionFactory

Provides the factory used to create lifecycle-aware service connections.

Link copied to clipboard
@Provides
fun provideShuttleVisibilityObservable(reporter: ShuttleVisibilityReporter, @Named(value = "MainScope") mainScope: CoroutineScope): ShuttleVisibilityObservable

Provides the ShuttleVisibilityObservable that routes visibility events to the reporter.

Link copied to clipboard
@Provides
fun provideVisibilityReporter(): ShuttleVisibilityReporter

Provides the ShuttleVisibilityReporter that logs Shuttle events via android.util.Log.