UserActivityInfo


class UserActivityInfo


Represents an update from Passive tracking.

Provides DataPoints associated with the Passive tracking, in addition to data related to the user's UserActivityState.

Summary

Public constructors

UserActivityInfo(
    userActivityState: UserActivityState,
    exerciseInfo: ExerciseInfo?,
    stateChangeTime: Instant
)

Public functions

open String

Public properties

ExerciseInfo?

The ExerciseInfo of the user for a UserActivityState.USER_ACTIVITY_EXERCISE state, and null for other UserActivityStates.

Instant

The time at which the current state took effect.

UserActivityState

The UserActivityState of the user from Passive tracking.

Public companion functions

createActiveExerciseState

Added in 1.0.0
fun createActiveExerciseState(
    exerciseInfo: ExerciseInfo,
    stateChangeTime: Instant
): UserActivityInfo

Creates a UserActivityInfo for USER_ACTIVITY_EXERCISE.

createAsleepState

Added in 1.0.0
fun createAsleepState(stateChangeTime: Instant): UserActivityInfo

Creates a UserActivityInfo for USER_ACTIVITY_ASLEEP.

createPassiveActivityState

Added in 1.0.0
fun createPassiveActivityState(stateChangeTime: Instant): UserActivityInfo

Creates a UserActivityInfo for USER_ACTIVITY_PASSIVE.

createUnknownTypeState

Added in 1.0.0
fun createUnknownTypeState(stateChangeTime: Instant): UserActivityInfo

Creates a UserActivityInfo for USER_ACTIVITY_UNKNOWN.

Public constructors

UserActivityInfo

Added in 1.0.0
UserActivityInfo(
    userActivityState: UserActivityState,
    exerciseInfo: ExerciseInfo?,
    stateChangeTime: Instant
)

Public functions

toString

open fun toString(): String

Public properties

exerciseInfo

Added in 1.0.0
val exerciseInfoExerciseInfo?

The ExerciseInfo of the user for a UserActivityState.USER_ACTIVITY_EXERCISE state, and null for other UserActivityStates.

stateChangeTime

Added in 1.0.0
val stateChangeTimeInstant

The time at which the current state took effect.

userActivityState

Added in 1.0.0
val userActivityStateUserActivityState

The UserActivityState of the user from Passive tracking.