SingletonKeyedAppStatesReporter

open class SingletonKeyedAppStatesReporter : KeyedAppStatesReporter
kotlin.Any
   ↳ androidx.enterprise.feedback.KeyedAppStatesReporter
   ↳ androidx.enterprise.feedback.SingletonKeyedAppStatesReporter

A KeyedAppStatesReporter that only allows a single instance to exist at one time, avoiding repeated instantiations.

Summary

Public methods

open static KeyedAppStatesReporter
getInstance(@NonNull context: Context)

Returns an instance of the reporter.

open static Unit
initialize(@NonNull context: Context, @NonNull executor: Executor)

Sets executor used to construct the singleton.

open Unit

open Unit

Public methods

getInstance

@NonNull open static fun getInstance(@NonNull context: Context): KeyedAppStatesReporter

Returns an instance of the reporter.

Creates and initializes an instance if one doesn't already exist.

initialize

open static fun initialize(@NonNull context: Context, @NonNull executor: Executor): Unit

Sets executor used to construct the singleton.

If required, this method must be called before calling getInstance(Context).

If this method is not called, the reporter will run on a newly-created thread. This newly-created thread will be cleaned up and recreated as necessary when idle.

setStates

open fun setStates(@NonNull states: MutableCollection<KeyedAppState!>): Unit

setStatesImmediate

open fun setStatesImmediate(@NonNull states: MutableCollection<KeyedAppState!>): Unit