RequirementsWatcher


@UnstableApi
class RequirementsWatcher


Watches whether the Requirements are met and notifies the Listener on changes.

Summary

Nested types

Notified when RequirementsWatcher instance first created and on changes whether the are met.

Public constructors

RequirementsWatcher(
    context: Context!,
    listener: RequirementsWatcher.Listener!,
    requirements: Requirements!
)

Public functions

Int

Starts watching for changes.

Unit

Stops watching for changes.

Public properties

Requirements!

Public constructors

RequirementsWatcher

RequirementsWatcher(
    context: Context!,
    listener: RequirementsWatcher.Listener!,
    requirements: Requirements!
)
Parameters
context: Context!

Any context.

listener: RequirementsWatcher.Listener!

Notified whether the Requirements are met.

requirements: Requirements!

The requirements to watch.

Public functions

start

@Requirements.RequirementFlags
fun start(): Int

Starts watching for changes. Must be called from a thread that has an associated . Listener methods are called on the caller thread.

Returns
Int

Initial RequirementFlags that are not met, or 0.

stop

fun stop(): Unit

Stops watching for changes.

Public properties

requirements

val requirementsRequirements!