PassiveListenerConfig.Builder


class PassiveListenerConfig.Builder


Builder for PassiveListenerConfig instances.

Summary

Public constructors

Public functions

PassiveListenerConfig

Returns the built PassiveListenerConfig.

PassiveListenerConfig.Builder

Sets the requested daily PassiveGoals that should be passively tracked.

PassiveListenerConfig.Builder
setDataTypes(dataTypes: Set<DataType<*, *>>)

Sets the requested DataTypes that should be passively tracked.

PassiveListenerConfig.Builder

Sets the requested HealthEvent.Types that should be passively tracked.

PassiveListenerConfig.Builder
setShouldUserActivityInfoBeRequested(
    shouldUserActivityInfoBeRequested: Boolean
)

Sets whether to request the UserActivityState updates.

Public constructors

Builder

Added in 1.0.0
Builder()

Public functions

build

Added in 1.0.0
fun build(): PassiveListenerConfig

Returns the built PassiveListenerConfig.

setDailyGoals

Added in 1.0.0
fun setDailyGoals(dailyGoals: Set<PassiveGoal>): PassiveListenerConfig.Builder

Sets the requested daily PassiveGoals that should be passively tracked.

Parameters
dailyGoals: Set<PassiveGoal>

the daily PassiveGoals that should be tracked passively

setDataTypes

fun setDataTypes(dataTypes: Set<DataType<*, *>>): PassiveListenerConfig.Builder

Sets the requested DataTypes that should be passively tracked.

setHealthEventTypes

Added in 1.0.0
fun setHealthEventTypes(healthEventTypes: Set<HealthEvent.Type>): PassiveListenerConfig.Builder

Sets the requested HealthEvent.Types that should be passively tracked.

Parameters
healthEventTypes: Set<HealthEvent.Type>

the HealthEvent.Types that should be tracked passively

setShouldUserActivityInfoBeRequested

Added in 1.0.0
fun setShouldUserActivityInfoBeRequested(
    shouldUserActivityInfoBeRequested: Boolean
): PassiveListenerConfig.Builder

Sets whether to request the UserActivityState updates. If not set they will not be included by default and PassiveListenerCallback.onUserActivityInfoReceived will not be invoked. UserActivityState requires android.Manifest.permission.ACTIVITY_RECOGNITION.

Parameters
shouldUserActivityInfoBeRequested: Boolean

whether to request user activity state tracking