# ExerciseClient

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClient.kt+class:androidx.health.services.client.ExerciseClient) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***


```
public interface ExerciseClient
```

<br />

*** ** * ** ***

Client which provides a way to subscribe to the health data of a device during an exercise.

## Summary

| ### Public methods |
|---|---|
| `default @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#addDebouncedGoalToActiveExerciseAsync(androidx.health.services.client.data.DebouncedGoal)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> debouncedGoal )` Adds a `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` for an active exercise. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#addGoalToActiveExerciseAsync(androidx.health.services.client.data.ExerciseGoal)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> exerciseGoal )` Adds an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` for an active exercise. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#clearUpdateCallbackAsync(androidx.health.services.client.ExerciseUpdateCallback)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback callback)` Clears the callback set using `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#setUpdateCallback(androidx.health.services.client.ExerciseUpdateCallback)`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#endExerciseAsync()()` Ends the current exercise, if it has been started. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#flushAsync()()` Flushes the sensors for the active exercise. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#getCapabilitiesAsync()()` Returns the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` of this client for the device. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#getCurrentExerciseInfoAsync()()` Returns the current `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#markLapAsync()()` Ends the current lap, calls `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback#onLapSummaryReceived(androidx.health.services.client.data.ExerciseLapSummary)` with data spanning the marked lap and starts a new lap. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#overrideAutoPauseAndResumeForActiveExerciseAsync(kotlin.Boolean)(boolean enabled)` Enables or disables auto pause/resume for the current exercise. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#overrideBatchingModesForActiveExerciseAsync(kotlin.collections.Set)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/BatchingMode> batchingModes )` Sets the batching mode for the current exercise. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#pauseExerciseAsync()()` Pauses the current exercise, if it is currently started. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#prepareExerciseAsync(androidx.health.services.client.data.WarmUpConfig)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/WarmUpConfig configuration)` Prepares for a new exercise. |
| `default @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#removeDebouncedGoalFromActiveExerciseAsync(androidx.health.services.client.data.DebouncedGoal)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> debouncedGoal )` Removes a debounced goal from an active exercise. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#removeGoalFromActiveExerciseAsync(androidx.health.services.client.data.ExerciseGoal)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> exerciseGoal )` Removes an exercise goal for an active exercise. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#resumeExerciseAsync()()` Resumes the current exercise, if it is currently paused. |
| `abstract void` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#setUpdateCallback(androidx.health.services.client.ExerciseUpdateCallback)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback callback)` Sets the callback for the current `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate`. |
| `abstract void` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#setUpdateCallback(java.util.concurrent.Executor,androidx.health.services.client.ExerciseUpdateCallback)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback callback )` Calls to the callback will be executed using the specified `https://developer.android.com/reference/java/util/concurrent/Executor.html`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#startExerciseAsync(androidx.health.services.client.data.ExerciseConfig)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseConfig configuration)` Starts a new exercise. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#updateExerciseTypeConfigAsync(androidx.health.services.client.data.ExerciseTypeConfig)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseTypeConfig exerciseTypeConfig )` Updates the configurable exercise type attributes for the current exercise. |

| ### Extension functions |
|---|---|
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).addDebouncedGoalToActiveExercise(androidx.health.services.client.data.DebouncedGoal)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> debouncedGoal )` Adds a `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` for an active exercise. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).addGoalToActiveExercise(androidx.health.services.client.data.ExerciseGoal)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> exerciseGoal )` Adds an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` for an active exercise. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).clearUpdateCallback(androidx.health.services.client.ExerciseUpdateCallback)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback callback )` Clears the callback set using `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#setUpdateCallback(androidx.health.services.client.ExerciseUpdateCallback)`. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).endExercise()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver)` Ends the current exercise, if it has been started. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).flush()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver)` Flushes the sensors for the active exercise. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).getCapabilities()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver )` Returns the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` of this client for the device. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).getCurrentExerciseInfo()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver )` Returns the current `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo`. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).markLap()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver)` Ends the current lap, calls `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback#onLapSummaryReceived(androidx.health.services.client.data.ExerciseLapSummary)` with data spanning the marked lap and starts a new lap. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).overrideAutoPauseAndResumeForActiveExercise(kotlin.Boolean)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, boolean enabled )` Enables or disables auto pause/resume for the current exercise. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).overrideBatchingModesForActiveExercise(kotlin.collections.Set)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/BatchingMode> batchingModes )` Sets the batching mode for the current exercise synchronously. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).pauseExercise()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver )` Pauses the current exercise, if it is currently started. |
| `default final void` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).prepareExercise(androidx.health.services.client.data.WarmUpConfig)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/WarmUpConfig configuration )` Prepares for a new exercise. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).removeDebouncedGoalFromActiveExercise(androidx.health.services.client.data.DebouncedGoal)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> debouncedGoal )` Removes a debounced goal from an active exercise. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).removeGoalFromActiveExercise(androidx.health.services.client.data.ExerciseGoal)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> exerciseGoal )` Removes an exercise goal for an active exercise. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).resumeExercise()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver )` Resumes the current exercise, if it is currently paused. |
| `default final void` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).startExercise(androidx.health.services.client.data.ExerciseConfig)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseConfig configuration )` Starts a new exercise. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html` | `https://developer.android.com/reference/androidx/health/services/client/ExerciseClientExtensionKt.https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#(androidx.health.services.client.ExerciseClient).updateExerciseTypeConfig(androidx.health.services.client.data.ExerciseTypeConfig)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseClient receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseTypeConfig exerciseTypeConfig )` Updates the configurable exercise type attributes for the current exercise. |

## Public methods

### addDebouncedGoalToActiveExerciseAsync

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health#1.1.0)

```
default @NonNull ListenableFuture<@NonNull Void> addDebouncedGoalToActiveExerciseAsync(
    @NonNull DebouncedGoal<@NonNull ?> debouncedGoal
)
```

Adds a `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` for an active exercise.

`https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal`s apply to only sample data types (e.g. HeartRate, Speed) for active exercises owned by the client, and will be invalidated once the exercise is complete. Note: To add goals for Cumulative DataTypes (i.e. steps, distance...) please see `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#addGoalToActiveExerciseAsync(androidx.health.services.client.data.ExerciseGoal)`.

Before adding, `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` should be checked for support against ExerciseTypeCapabilities.supportedDebouncedGoals. Only one `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` is allowed per `https://developer.android.com/reference/androidx/health/services/client/data/DataType`+ComparisonType combination.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> debouncedGoal` | the `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` to add to this exercise |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes when WHS received the request to add the `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal`. This `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` fails if any of the following occur: 1. the calling app does not own the active exercise 2. the `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#addDebouncedGoalToActiveExerciseAsync(androidx.health.services.client.data.DebouncedGoal)` is not supported for the given `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType` |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-not-implemented-error/index.html` | if there is an existing `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient` that has not implemented this method. Developers should use HealthServices.getClient(context).exerciseClient, which is guaranteed to have this method implemented. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServices#getClient(android.content.Context)` | (context).exerciseClient |

### addGoalToActiveExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> addGoalToActiveExerciseAsync(
    @NonNull ExerciseGoal<@NonNull ?> exerciseGoal
)
```

Adds an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` for an active exercise.

Goals apply to only active exercises owned by the client, and will be invalidated once the exercise is complete.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> exerciseGoal` | the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` to add to this exercise |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the exercise goal has been added. This returned `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` fails if the calling app does not own the active exercise. |

### clearUpdateCallbackAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> clearUpdateCallbackAsync(@NonNull ExerciseUpdateCallback callback)
```

Clears the callback set using `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#setUpdateCallback(androidx.health.services.client.ExerciseUpdateCallback)`.

If this callback is not already registered then this will be a no-op.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback callback` | the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` to clear |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the callback has been cleared (or verified not to be set). |

### endExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> endExerciseAsync()
```

Ends the current exercise, if it has been started.

Health Services will flush and then shut down the active sensors and return an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` along with the reason `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEndReason.Companion#USER_END()` to the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback`. If the exercise has ended then this future will fail.

No additional metrics will be produced for the exercise and any on device persisted data about the exercise will be deleted after the summary has been sent back.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the exercise has been ended or fails if the calling application does not own the active exercise. |

### flushAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> flushAsync()
```

Flushes the sensors for the active exercise. This call should be used sparingly and will be subject to throttling by Health Services.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the flush has been completed or fails if the calling application does not own the active exercise. |

### getCapabilitiesAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull ExerciseCapabilities> getCapabilitiesAsync()
```

Returns the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` of this client for the device.

This can be used to determine what `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType`s and `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s this device supports. Clients should use the capabilities to inform their requests since Health Services will typically reject requests made for `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s or features (such as auto-pause) which are not enabled for the rejected `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType`.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` containing the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` for this device |

### getCurrentExerciseInfoAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull ExerciseInfo> getCurrentExerciseInfoAsync()
```

Returns the current `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo`.

This can be used by clients to determine if they or another app already owns an active exercise being tracked by Health Services. For example, if an app is killed and it learns it owns the active exercise it can register a new `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` and pick tracking up from where it left off.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that contains information about the current exercise or fails if the calling application does not own the active exercise |

### markLapAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> markLapAsync()
```

Ends the current lap, calls `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback#onLapSummaryReceived(androidx.health.services.client.data.ExerciseLapSummary)` with data spanning the marked lap and starts a new lap. If the exercise supports laps this method can be called at any point after an exercise has been started and before it has been ended regardless of the exercise status.

The metrics in the lap summary will start from either the start time of the exercise or the last time a lap was marked to the time this method is being called.

If there's no exercise being tracked or if the exercise does not support laps then this future will fail.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the lap has been marked successfully or fails if the calling application does not own the active exercise |

### overrideAutoPauseAndResumeForActiveExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> overrideAutoPauseAndResumeForActiveExerciseAsync(boolean enabled)
```

Enables or disables auto pause/resume for the current exercise.

| Parameters |
|---|---|
| `boolean enabled` | a boolean to indicate if should be enabled or disabled |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the override has completed. This returned `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` fails if an exercise is not active for this app. |

### overrideBatchingModesForActiveExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> overrideBatchingModesForActiveExerciseAsync(
    @NonNull Set<@NonNull BatchingMode> batchingModes
)
```

Sets the batching mode for the current exercise.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/BatchingMode> batchingModes` | `https://developer.android.com/reference/androidx/health/services/client/data/BatchingMode` overrides for exercise updates. Passing an empty set will clear all existing overrides. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the override has completed. This returned `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` fails if an exercise is not active for this app. |

### pauseExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> pauseExerciseAsync()
```

Pauses the current exercise, if it is currently started.

Before transitioning to `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#USER_PAUSED()`, Health Services will flush and return the sensor data. While the exercise is paused, active time and cumulative metrics such as distance will not accumulate. Instantaneous measurements such as speed and heart rate will continue to update if requested in the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseConfig`.

Note that GPS and other sensors may be stopped when the exercise is paused in order to conserve battery. This may happen immediately, or after some time. (The exact behavior is hardware dependent.) Should this happen, access will automatically resume when the exercise is resumed.

If the exercise is already paused then this method has no effect. If the exercise has ended then the returned future will fail.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the exercise has been paused or fails if the calling application does not own the active exercise. |

### prepareExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> prepareExerciseAsync(@NonNull WarmUpConfig configuration)
```

Prepares for a new exercise.

Once called, Health Services will warmup the sensors based on the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType` and requested `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s

If the calling app already has an active exercise in progress or if it does not have the required permissions, then this call returns a failed future. If another app owns the active exercise then this call will succeed.

Sensors available for warmup are GPS `https://developer.android.com/reference/androidx/health/services/client/data/DataType#LOCATION()` and HeartRate `https://developer.android.com/reference/androidx/health/services/client/data/DataType#HEART_RATE_BPM()`. Other `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s requested for warmup based on exercise capabilities will be a no-op for the prepare stage.

The DataType availability can be obtained through the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback#onAvailabilityChanged(androidx.health.services.client.data.DataType,androidx.health.services.client.data.Availability)` callback. `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate`s with the supported DataType `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint` will also be returned in the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#PREPARING()` state, though no aggregation will occur until the exercise is started.

If an app is actively preparing and another app starts tracking an active exercise then the preparing app should expect to receive an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` along with the reason `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEndReason.Companion#AUTO_END_SUPERSEDED()` to the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` indicating that their session has been superseded and ended. At that point no additional updates to availability or data will be sent until the app calls prepareExercise again.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/WarmUpConfig configuration` | the `https://developer.android.com/reference/androidx/health/services/client/data/WarmUpConfig` containing the desired exercise and data types |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once Health Services starts preparing the sensors or fails due to missing permissions or the app owning another active exercise. |

### removeDebouncedGoalFromActiveExerciseAsync

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health#1.1.0)

```
default @NonNull ListenableFuture<@NonNull Void> removeDebouncedGoalFromActiveExerciseAsync(
    @NonNull DebouncedGoal<@NonNull ?> debouncedGoal
)
```

Removes a debounced goal from an active exercise.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> debouncedGoal` | the `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` to remove from this exercise |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the debounced goal has been removed. This returned `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` fails if the exercise is not active, and will be a no-op if `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#removeDebouncedGoalFromActiveExerciseAsync(androidx.health.services.client.data.DebouncedGoal)` has not been added in the past. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-not-implemented-error/index.html` | if there is an existing `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient` that has not implemented this method. Developers should use HealthServices.getClient(context).exerciseClient, which is guaranteed to have this method implemented. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServices#getClient(android.content.Context)` | (context).exerciseClient |

### removeGoalFromActiveExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> removeGoalFromActiveExerciseAsync(
    @NonNull ExerciseGoal<@NonNull ?> exerciseGoal
)
```

Removes an exercise goal for an active exercise.

Takes into account equivalent milestones (i.e. milestones which are not equal but are different representation of a common milestone. e.g. milestone A for every 2kms, currently at threshold of 10kms, and milestone B for every 2kms, currently at threshold of 8kms).

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> exerciseGoal` | the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` to remove from this exercise |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the exercise goal has been removed. This returned `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` fails if the exercise is not active, and will be a no-op if `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#removeGoalFromActiveExerciseAsync(androidx.health.services.client.data.ExerciseGoal)` has not been added in the past. |

### resumeExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> resumeExerciseAsync()
```

Resumes the current exercise, if it is currently paused.

Once resumed active time and cumulative metrics such as distance will resume accumulating.

If the exercise has been started but is not currently paused this method has no effect. If the exercise has ended then the returned future will fail.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the exercise has been resumed or fails if the calling application does not own the active exercise. |

### setUpdateCallback

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract void setUpdateCallback(@NonNull ExerciseUpdateCallback callback)
```

Sets the callback for the current `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate`.

This callback won't be called until the calling application prepares or starts an exercise. It will only receive updates from exercises tracked by this app.

If an exercise is in progress, the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` is immediately called with the associated `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate`, and subsequently whenever the state is updated or an event is triggered. Health Services will cache `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate`s of an active exercise that are generated while a callback is not active (for example, due to the app getting killed) and deliver them as soon as the callback is registered again. If the client fails to maintain a live `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` for at least five minutes during the duration of the exercise Health Services can decide to terminate the exercise automatically. If this occurs, clients can expect to receive an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` along with the reason `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEndReason.Companion#AUTO_END_MISSING_LISTENER()` to the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` indicating that their exercise has been automatically ended due to the lack of callback.

Calls to the callback will be executed on the main application thread. To control where to execute the callback, see the overload taking an `https://developer.android.com/reference/java/util/concurrent/Executor.html`. To remove the callback use `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#clearUpdateCallbackAsync(androidx.health.services.client.ExerciseUpdateCallback)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback callback` | the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` that will receive updates from Health Services |

### setUpdateCallback

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract void setUpdateCallback(
    @NonNull Executor executor,
    @NonNull ExerciseUpdateCallback callback
)
```

Calls to the callback will be executed using the specified `https://developer.android.com/reference/java/util/concurrent/Executor.html`. To execute the callback on the main application thread use the overload without the `https://developer.android.com/reference/java/util/concurrent/Executor.html`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor` | the `https://developer.android.com/reference/java/util/concurrent/Executor.html` on which `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#setUpdateCallback(java.util.concurrent.Executor,androidx.health.services.client.ExerciseUpdateCallback)` will be invoked |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback callback` | the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` that will receive updates from Health Services |

### startExerciseAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> startExerciseAsync(@NonNull ExerciseConfig configuration)
```

Starts a new exercise.

Once started, Health Services will begin collecting data associated with the exercise.

Since Health Services only allows a single active exercise at a time, this will terminate any active exercise currently in progress before starting the new one. If this occurs, clients can expect to receive an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` along with the reason `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEndReason.Companion#AUTO_END_SUPERSEDED()` to the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` indicating that their exercise has been superseded and that no additional updates will be sent. Clients can use `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#getCurrentExerciseInfoAsync()` (described below) to check if they or another app has an active exercise in-progress.

The exercise will be terminated and clients can expect to receive an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` along with the reason `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEndReason.Companion#AUTO_END_MISSING_LISTENER()` (indicating that their exercise has been automatically ended due to the lack of callback) if there is ever a five minute period where no `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` is registered. A notable example is if the process with the registered `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` dies and does not re-register the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` within five minutes.

Clients should only request `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType`s, `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s, goals, and auto-pause enabled that matches the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` returned by `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#getCapabilitiesAsync()` since Health Services will reject requests asking for unsupported configurations.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseConfig configuration` | the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseConfig` describing this exercise |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes once the exercise has been started or fails due to the application missing the required permissions or requesting metrics which are not supported for the given `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType`. |

### updateExerciseTypeConfigAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
abstract @NonNull ListenableFuture<@NonNull Void> updateExerciseTypeConfigAsync(
    @NonNull ExerciseTypeConfig exerciseTypeConfig
)
```

Updates the configurable exercise type attributes for the current exercise.

This can be used to update the configurable attributes for the ongoing exercise, as defined in `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseTypeConfig`. Minimum Exercise API version for this function is 3.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseTypeConfig exerciseTypeConfig` | a configuration containing the new values for the configurable attributes |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes when the configuration has been updated. |

## Extension functions

### ExerciseClientExtensionKt.addDebouncedGoalToActiveExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:addDebouncedGoalToActiveExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.addDebouncedGoalToActiveExercise(
    @NonNull ExerciseClient receiver,
    @NonNull DebouncedGoal<@NonNull ?> debouncedGoal
)
```

Adds a `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` for an active exercise.

`https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal`s apply to only sample data types (e.g. HeartRate, Speed) for active exercises owned by the client, and will be invalidated once the exercise is complete. Note: To add goals for Cumulative DataTypes (i.e. steps, distance...) please see `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#addGoalToActiveExerciseAsync(androidx.health.services.client.data.ExerciseGoal)`.

Before adding, `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` should be checked for support against ExerciseTypeCapabilities.supportedDebouncedGoals. Only one `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` is allowed per `https://developer.android.com/reference/androidx/health/services/client/data/DataType`+ComparisonType pair.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> debouncedGoal` | the `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` to add to this exercise |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |

### ExerciseClientExtensionKt.addGoalToActiveExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:addGoalToActiveExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.addGoalToActiveExercise(
    @NonNull ExerciseClient receiver,
    @NonNull ExerciseGoal<@NonNull ?> exerciseGoal
)
```

Adds an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` for an active exercise.

Goals apply to only active exercises owned by the client, and will be invalidated once the exercise is complete.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> exerciseGoal` | the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` to add to this exercise |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |

### ExerciseClientExtensionKt.clearUpdateCallback

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:clearUpdateCallback)

```
default final @NonNull Void ExerciseClientExtensionKt.clearUpdateCallback(
    @NonNull ExerciseClient receiver,
    @NonNull ExerciseUpdateCallback callback
)
```

Clears the callback set using `https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#setUpdateCallback(androidx.health.services.client.ExerciseUpdateCallback)`.

If this callback is not already registered then this will be a no-op.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback callback` | the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` to clear |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |

### ExerciseClientExtensionKt.endExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:endExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.endExercise(@NonNull ExerciseClient receiver)
```

Ends the current exercise, if it has been started.

Health Services will flush and then shut down the active sensors and return an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` along with the reason `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEndReason.Companion#USER_END()` to the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback`. If the exercise has already ended then this call fails with a `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException`.

No additional metrics will be produced for the exercise and any on device persisted data about the exercise will be deleted after the summary has been sent back.

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if exercise has already ended or if Health Service fails to process the call |

### ExerciseClientExtensionKt.flush

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:flush)

```
default final @NonNull Void ExerciseClientExtensionKt.flush(@NonNull ExerciseClient receiver)
```

Flushes the sensors for the active exercise. This call should be used sparingly and will be subject to throttling by Health Services.

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if the Health Service fails to process the request |

### ExerciseClientExtensionKt.getCapabilities

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:getCapabilities)

```
default final @NonNull ExerciseCapabilities ExerciseClientExtensionKt.getCapabilities(
    @NonNull ExerciseClient receiver
)
```

Returns the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` of this client for the device.

This can be used to determine what `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType`s and `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s this device supports. Clients should use the capabilities to inform their requests since Health Services will typically reject requests made for `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s or features (such as auto-pause) which are not enabled for the rejected `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType`.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` | a the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` for this device |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |

### ExerciseClientExtensionKt.getCurrentExerciseInfo

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:getCurrentExerciseInfo)

```
default final @NonNull ExerciseInfo ExerciseClientExtensionKt.getCurrentExerciseInfo(
    @NonNull ExerciseClient receiver
)
```

Returns the current `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo`.

This can be used by clients to determine if they or another app already owns an active exercise being tracked by Health Services. For example, if an app is killed and it learns it owns the active exercise it can register a new `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` and pick tracking up from where it left off.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo` | a `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseInfo` that contains information about the current exercise |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |

### ExerciseClientExtensionKt.markLap

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:markLap)

```
default final @NonNull Void ExerciseClientExtensionKt.markLap(@NonNull ExerciseClient receiver)
```

Ends the current lap, calls `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback#onLapSummaryReceived(androidx.health.services.client.data.ExerciseLapSummary)` with data spanning the marked lap and starts a new lap. If the exercise supports laps this method can be called at any point after an exercise has been started and before it has been ended regardless of the exercise status.

The metrics in the lap summary will start from either the start time of the exercise or the last time a lap was marked to the time this method is being called.

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | If there's no exercise being tracked or if Health Service fails to process the call |

### ExerciseClientExtensionKt.overrideAutoPauseAndResumeForActiveExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:overrideAutoPauseAndResumeForActiveExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.overrideAutoPauseAndResumeForActiveExercise(
    @NonNull ExerciseClient receiver,
    boolean enabled
)
```

Enables or disables auto pause/resume for the current exercise.

| Parameters |
|---|---|
| `boolean enabled` | a boolean to indicate if should be enabled or disabled |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |

### ExerciseClientExtensionKt.overrideBatchingModesForActiveExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:overrideBatchingModesForActiveExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.overrideBatchingModesForActiveExercise(
    @NonNull ExerciseClient receiver,
    @NonNull Set<@NonNull BatchingMode> batchingModes
)
```

Sets the batching mode for the current exercise synchronously.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/BatchingMode> batchingModes` | `https://developer.android.com/reference/androidx/health/services/client/data/BatchingMode` overrides for exercise updates. Passing an empty set will clear all existing overrides. |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if an exercise is not active for this app or Health Service fails to process the call |

### ExerciseClientExtensionKt.pauseExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:pauseExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.pauseExercise(
    @NonNull ExerciseClient receiver
)
```

Pauses the current exercise, if it is currently started.

Before transitioning to `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#USER_PAUSED()`, Health Services will flush and return the sensor data. While the exercise is paused, active time and cumulative metrics such as distance will not accumulate. Instantaneous measurements such as speed and heart rate will continue to update if requested in the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseConfig`.

Note that GPS and other sensors may be stopped when the exercise is paused in order to conserve battery. This may happen immediately, or after some time. (The exact behavior is hardware dependent.) Should this happen, access will automatically resume when the exercise is resumed.

If the exercise is already paused then this method has no effect. If the exercise has ended then `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` is thrown.

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if the exercise has ended or if Health Service fails to process the call |

### ExerciseClientExtensionKt.prepareExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:prepareExercise)

```
default final void ExerciseClientExtensionKt.prepareExercise(
    @NonNull ExerciseClient receiver,
    @NonNull WarmUpConfig configuration
)
```

Prepares for a new exercise.

Once called, Health Services will warmup the sensors based on the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType` and requested `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s.

If the calling app already has an active exercise in progress or if it does not have the required permissions, then this call throws `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException`. If another app owns the active exercise then this call will succeed.

Sensors available for warmup are GPS `https://developer.android.com/reference/androidx/health/services/client/data/DataType#LOCATION()` and HeartRate `https://developer.android.com/reference/androidx/health/services/client/data/DataType#HEART_RATE_BPM()`. Other `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s requested for warmup based on exercise capabilities will be a no-op for the prepare stage.

The DataType availability can be obtained through the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback#onAvailabilityChanged(androidx.health.services.client.data.DataType,androidx.health.services.client.data.Availability)` callback. `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate`s with the supported DataType `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint` will also be returned in the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#PREPARING()` state, though no aggregation will occur until the exercise is started.

If an app is actively preparing and another app starts tracking an active exercise then the preparing app should expect to receive an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` along with the reason `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEndReason.Companion#AUTO_END_SUPERSEDED()` to the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` indicating that their session has been superseded and ended. At that point no additional updates to availability or data will be sent until the app calls prepareExercise again.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/WarmUpConfig configuration` | the `https://developer.android.com/reference/androidx/health/services/client/data/WarmUpConfig` containing the desired exercise and data types |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if the calling app already has an active exercise in progress or if Health Service fails to process the call |
| `https://developer.android.com/reference/java/lang/SecurityException.html` | if the calling app does not have the required permissions |

### ExerciseClientExtensionKt.removeDebouncedGoalFromActiveExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:removeDebouncedGoalFromActiveExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.removeDebouncedGoalFromActiveExercise(
    @NonNull ExerciseClient receiver,
    @NonNull DebouncedGoal<@NonNull ?> debouncedGoal
)
```

Removes a debounced goal from an active exercise.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> debouncedGoal` | the `https://developer.android.com/reference/androidx/health/services/client/data/DebouncedGoal` to remove from this exercise |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |

### ExerciseClientExtensionKt.removeGoalFromActiveExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:removeGoalFromActiveExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.removeGoalFromActiveExercise(
    @NonNull ExerciseClient receiver,
    @NonNull ExerciseGoal<@NonNull ?> exerciseGoal
)
```

Removes an exercise goal for an active exercise.

Takes into account equivalent milestones (i.e. milestones which are not equal but are different representation of a common milestone. e.g. milestone A for every 2kms, currently at threshold of 10kms, and milestone B for every 2kms, currently at threshold of 8kms).

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull ?> exerciseGoal` | the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` to remove from this exercise |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |

### ExerciseClientExtensionKt.resumeExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:resumeExercise)

```
default final @NonNull Void ExerciseClientExtensionKt.resumeExercise(
    @NonNull ExerciseClient receiver
)
```

Resumes the current exercise, if it is currently paused.

Once resumed active time and cumulative metrics such as distance will resume accumulating.

If the exercise has been started but is not currently paused this method has no effect. If the exercise has ended then `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` is thrown.

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if the exercise has ended or if Health Service fails to process the call |

### ExerciseClientExtensionKt.startExercise

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:startExercise)

```
default final void ExerciseClientExtensionKt.startExercise(
    @NonNull ExerciseClient receiver,
    @NonNull ExerciseConfig configuration
)
```

Starts a new exercise.

Once started, Health Services will begin collecting data associated with the exercise.

Since Health Services only allows a single active exercise at a time, this will terminate any active exercise currently in progress before starting the new one. If this occurs, clients can expect to receive an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()`, indicating that their exercise has been superseded and that no additional updates will be sent. Clients can use `https://developer.android.com/reference/androidx/health/services/client/package-summary#(androidx.health.services.client.ExerciseClient).getCurrentExerciseInfo()` (described below) to check if they or another app has an active exercise in-progress.

The exercise will be terminated and clients can expect to receive an `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate` with `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` along with the reason `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseEndReason.Companion#AUTO_END_MISSING_LISTENER()` (indicating that their exercise has been automatically ended due to the lack of callback) if there is ever a five minute period where no `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` is registered. A notable example is if the process with the registered `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` dies and does not re-register the `https://developer.android.com/reference/androidx/health/services/client/ExerciseUpdateCallback` within five minutes.

Clients should only request `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseType`s, `https://developer.android.com/reference/androidx/health/services/client/data/DataType`s, goals, and auto-pause enabled that matches the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseCapabilities` returned by `https://developer.android.com/reference/androidx/health/services/client/package-summary#(androidx.health.services.client.ExerciseClient).getCapabilities()` since Health Services will reject requests asking for unsupported configurations.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseConfig configuration` | the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseConfig` describing this exercise |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |
| `https://developer.android.com/reference/java/lang/SecurityException.html` | if the calling app does not have the required permissions |

### ExerciseClientExtensionKt.updateExerciseTypeConfig

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ExerciseClientExtension.kt+function:updateExerciseTypeConfig)

```
default final @NonNull Void ExerciseClientExtensionKt.updateExerciseTypeConfig(
    @NonNull ExerciseClient receiver,
    @NonNull ExerciseTypeConfig exerciseTypeConfig
)
```

Updates the configurable exercise type attributes for the current exercise.

This can be used to update the configurable attributes for the ongoing exercise, as defined in `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseTypeConfig`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseTypeConfig exerciseTypeConfig` | configuration containing the new values for the configurable attributes |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if Health Service fails to process the call |