MeshServiceClient

A Activity-lifecycle-aware ServiceClient that binds MeshService once the Activity is started.

Constructors

Link copied to clipboard
constructor(context: Context, serviceRepository: AndroidServiceRepository, serviceSetupJob: SequentialJob)

Properties

Link copied to clipboard

Returns the bound service instance. If not currently connected, this will block the current thread until the connection is established.

Link copied to clipboard

The currently bound service instance, or null if not connected.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
suspend fun connect(c: Context, intent: Intent, flags: Int)

Initiates a binding to the service.

Link copied to clipboard
open override fun onConnected(service: IMeshService)

Called on the main thread when the service is connected.

Link copied to clipboard
open fun onCreate(owner: LifecycleOwner)
Link copied to clipboard
open override fun onDestroy(owner: LifecycleOwner)
Link copied to clipboard
open override fun onDisconnected()

Called on the main thread when the service connection is lost.

Link copied to clipboard
open fun onPause(owner: LifecycleOwner)
Link copied to clipboard
open fun onResume(owner: LifecycleOwner)
Link copied to clipboard
open override fun onStart(owner: LifecycleOwner)
Link copied to clipboard
open override fun onStop(owner: LifecycleOwner)
Link copied to clipboard

Blocks the current thread until the service is connected.