ExerciseUpdate.ActiveDurationCheckpoint


class ExerciseUpdate.ActiveDurationCheckpoint


This records the last time the exercise transitioned from an active to an inactive state or from an inactive to an active state, where inactive states match those found in ExerciseState.isPaused or ExerciseState.isEnded. This can be used to calculate the exercise active duration in a way that is consistent with Health Service's view of the exercise.

If the exercise is currently inactive, the exercise’s active duration will match activeDuration below. If the exercise is active, the active duration can be calculated by activeDuration + (now() - time).

Summary

Public constructors

ActiveDurationCheckpoint(time: Instant, activeDuration: Duration)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Duration

Returns the active duration of the exercise at the time it last transitioned to "active", or the duration when it transitioned to inactive if it's currently paused or stopped.

Instant

Returns the time at which the exercise last transitioned between the active or inactive states.

Public constructors

ActiveDurationCheckpoint

Added in 1.0.0
ActiveDurationCheckpoint(time: Instant, activeDuration: Duration)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

activeDuration

Added in 1.0.0
val activeDurationDuration

Returns the active duration of the exercise at the time it last transitioned to "active", or the duration when it transitioned to inactive if it's currently paused or stopped.

time

Added in 1.0.0
val timeInstant

Returns the time at which the exercise last transitioned between the active or inactive states.