PassiveListenerConfig
public final class PassiveListenerConfig
Defines configuration for a passive monitoring listener request using Health Services.
Summary
Nested types |
|---|
public final class PassiveListenerConfig.BuilderBuilder for |
Public constructors |
|---|
PassiveListenerConfig(Creates a new |
Public methods |
|
|---|---|
static final @NonNull PassiveListenerConfig.Builder |
builder() |
final @NonNull Set<@NonNull PassiveGoal> |
set of daily |
final @NonNull Set<@NonNull DataType<@NonNull Object, @NonNull DataPoint<@NonNull Object>>> |
set of |
final @NonNull Set<@NonNull HealthEvent.Type> |
set of |
final boolean |
whether to request |
Public constructors
PassiveListenerConfig
public PassiveListenerConfig(
@NonNull Set<@NonNull DataType<@NonNull Object, @NonNull DataPoint<@NonNull Object>>> dataTypes,
boolean shouldUserActivityInfoBeRequested,
@NonNull Set<@NonNull PassiveGoal> dailyGoals,
@NonNull Set<@NonNull HealthEvent.Type> healthEventTypes
)
Creates a new PassiveListenerConfig which defines a request for passive monitoring using Health Services
Public methods
getDailyGoals
public final @NonNull Set<@NonNull PassiveGoal> getDailyGoals()
set of daily PassiveGoals which should be tracked. Achieved goals will be returned by PassiveListenerCallback.onGoalCompleted.
getDataTypes
public final @NonNull Set<@NonNull DataType<@NonNull Object, @NonNull DataPoint<@NonNull Object>>> getDataTypes()
set of DataTypes which should be tracked. Requested data will be returned by PassiveListenerCallback.onNewDataPointsReceived.
getHealthEventTypes
public final @NonNull Set<@NonNull HealthEvent.Type> getHealthEventTypes()
set of HealthEvent.Type which should be tracked. Detected health events will be returned by PassiveListenerCallback.onHealthEventReceived.
shouldUserActivityInfoBeRequested
public final boolean shouldUserActivityInfoBeRequested()
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.