PassiveListenerConfig.Builder


public final class PassiveListenerConfig.Builder


Builder for PassiveListenerConfig instances.

Summary

Public constructors

Public methods

final @NonNull PassiveListenerConfig

Returns the built PassiveListenerConfig.

final @NonNull PassiveListenerConfig.Builder

Sets the requested daily PassiveGoals that should be passively tracked.

final @NonNull PassiveListenerConfig.Builder
setDataTypes(
    @NonNull Set<@NonNull DataType<@NonNull ?, @NonNull ?>> dataTypes
)

Sets the requested DataTypes that should be passively tracked.

final @NonNull PassiveListenerConfig.Builder

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

final @NonNull PassiveListenerConfig.Builder
setShouldUserActivityInfoBeRequested(
    boolean shouldUserActivityInfoBeRequested
)

Sets whether to request the UserActivityState updates.

Public constructors

Builder

Added in 1.0.0
public Builder()

Public methods

build

Added in 1.0.0
public final @NonNull PassiveListenerConfig build()

Returns the built PassiveListenerConfig.

setDailyGoals

Added in 1.0.0
public final @NonNull PassiveListenerConfig.Builder setDailyGoals(@NonNull Set<@NonNull PassiveGoal> dailyGoals)

Sets the requested daily PassiveGoals that should be passively tracked.

Parameters
@NonNull Set<@NonNull PassiveGoal> dailyGoals

the daily PassiveGoals that should be tracked passively

setDataTypes

public final @NonNull PassiveListenerConfig.Builder setDataTypes(
    @NonNull Set<@NonNull DataType<@NonNull ?, @NonNull ?>> dataTypes
)

Sets the requested DataTypes that should be passively tracked.

setHealthEventTypes

Added in 1.0.0
public final @NonNull PassiveListenerConfig.Builder setHealthEventTypes(
    @NonNull Set<@NonNull HealthEvent.Type> healthEventTypes
)

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

Parameters
@NonNull Set<@NonNull HealthEvent.Type> healthEventTypes

the HealthEvent.Types that should be tracked passively

setShouldUserActivityInfoBeRequested

Added in 1.0.0
public final @NonNull PassiveListenerConfig.Builder setShouldUserActivityInfoBeRequested(
    boolean shouldUserActivityInfoBeRequested
)

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
boolean shouldUserActivityInfoBeRequested

whether to request user activity state tracking