ExerciseUpdate
class ExerciseUpdate
Contains the latest updated state and metrics for the current exercise.
Summary
Nested types |
|---|
|
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 |
Public functions |
|
|---|---|
open operator Boolean |
|
Duration |
getActiveDurationAtDataPoint(dataPoint: IntervalDataPoint<*>)Returns the ActiveDuration of the exercise at the time of the provided |
Duration |
getActiveDurationAtDataPoint(dataPoint: SampleDataPoint<*>)Returns the ActiveDuration of the exercise at the time of the provided |
Duration |
Returns the duration since boot when this ExerciseUpdate was created. |
open Int |
hashCode() |
open String |
toString() |
Public properties |
|
|---|---|
ExerciseUpdate.ActiveDurationCheckpoint? |
Returns the |
ExerciseConfig? |
Returns the |
ExerciseStateInfo |
Returns the |
Set<DebouncedGoal<Number>> |
Returns the latest |
Set<ExerciseGoal<Number>> |
Returns the latest |
DataPointContainer |
Returns the list of the latest |
Set<MilestoneMarkerSummary> |
Returns the latest |
Instant? |
Returns the time at which the exercise was started or |
Public functions
getActiveDurationAtDataPoint
fun getActiveDurationAtDataPoint(dataPoint: IntervalDataPoint<*>): Duration
Returns the ActiveDuration of the exercise at the time of the provided IntervalDataPoint. The provided IntervalDataPoint should be present in this ExerciseUpdate.
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if |
kotlin.IllegalStateException |
if this |
getActiveDurationAtDataPoint
fun getActiveDurationAtDataPoint(dataPoint: SampleDataPoint<*>): Duration
Returns the ActiveDuration of the exercise at the time of the provided SampleDataPoint. The provided SampleDataPoint should be present in this ExerciseUpdate.
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if |
getUpdateDurationFromBoot
fun getUpdateDurationFromBoot(): Duration
Returns the duration since boot when this ExerciseUpdate was created.
| Throws | |
|---|---|
kotlin.IllegalStateException |
if this |
Public properties
activeDurationCheckpoint
val activeDurationCheckpoint: ExerciseUpdate.ActiveDurationCheckpoint?
Returns the ActiveDurationCheckpoint which can be used to determine the active duration of the exercise in a way that is consistent with Health Services. Clients can anchor their application timers against this to ensure their view of the active duration matches the view of Health Services.
exerciseConfig
val exerciseConfig: ExerciseConfig?
Returns the ExerciseConfig used by the exercise when the ExerciseUpdate was dispatched and returns null if the exercise is in prepare phase and hasn't been started yet.
exerciseStateInfo
val exerciseStateInfo: ExerciseStateInfo
Returns the ExerciseStateInfo containing the current ExerciseState and ExerciseEndReason, if applicable.
latestAchievedDebouncedGoals
val latestAchievedDebouncedGoals: Set<DebouncedGoal<Number>>
Returns the latest DebouncedGoals that have been achieved.
latestAchievedGoals
val latestAchievedGoals: Set<ExerciseGoal<Number>>
Returns the latest ExerciseGoalType.ONE_TIME_GOALs that have been achieved. ExerciseGoalType.MILESTONEs will be returned via latestMilestoneMarkerSummaries.
latestMetrics
val latestMetrics: DataPointContainer
Returns the list of the latest DataPoints.
latestMilestoneMarkerSummaries
val latestMilestoneMarkerSummaries: Set<MilestoneMarkerSummary>
Returns the latest MilestoneMarkerSummarys.