PassiveListenerConfig


class PassiveListenerConfig


Defines configuration for a passive monitoring listener request using Health Services.

Summary

Nested types

Builder for PassiveListenerConfig instances.

Public companion functions

PassiveListenerConfig.Builder

Public constructors

PassiveListenerConfig(
    dataTypes: Set<DataType<AnyDataPoint<Any>>>,
    shouldUserActivityInfoBeRequested: Boolean,
    dailyGoals: Set<PassiveGoal>,
    healthEventTypes: Set<HealthEvent.Type>
)

Creates a new PassiveListenerConfig which defines a request for passive monitoring using Health Services

Public properties

Set<PassiveGoal>

set of daily PassiveGoals which should be tracked.

Set<DataType<AnyDataPoint<Any>>>

set of DataTypes which should be tracked.

Set<HealthEvent.Type>

set of HealthEvent.Type which should be tracked.

Boolean

whether to request UserActivityInfo updates.

Public companion functions

builder

Added in 1.0.0
fun builder(): PassiveListenerConfig.Builder

Public constructors

PassiveListenerConfig

PassiveListenerConfig(
    dataTypes: Set<DataType<AnyDataPoint<Any>>>,
    shouldUserActivityInfoBeRequested: Boolean,
    dailyGoals: Set<PassiveGoal>,
    healthEventTypes: Set<HealthEvent.Type>
)

Creates a new PassiveListenerConfig which defines a request for passive monitoring using Health Services

Public properties

dailyGoals

Added in 1.0.0
val dailyGoalsSet<PassiveGoal>

set of daily PassiveGoals which should be tracked. Achieved goals will be returned by PassiveListenerCallback.onGoalCompleted.

dataTypes

Added in 1.0.0
val dataTypesSet<DataType<AnyDataPoint<Any>>>

set of DataTypes which should be tracked. Requested data will be returned by PassiveListenerCallback.onNewDataPointsReceived.

healthEventTypes

Added in 1.0.0
val healthEventTypesSet<HealthEvent.Type>

set of HealthEvent.Type which should be tracked. Detected health events will be returned by PassiveListenerCallback.onHealthEventReceived.

shouldUserActivityInfoBeRequested

Added in 1.1.0-alpha04
val shouldUserActivityInfoBeRequestedBoolean

whether to request UserActivityInfo updates. Data will be returned by PassiveListenerCallback.onUserActivityInfoReceived. If set to true, calling app must have android.Manifest.permission.ACTIVITY_RECOGNITION.