android / android/health-samples

Add appropriate error handling

Open
#61 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
346
Forks
183
PR merge metrics
No merged PRs in 30d

Description

From https://github.com/android/health-samples/blob/2220ea6611770b56350d26502faefc28791f3cbd/health-services/ExerciseSample/app/src/main/java/com/example/exercise/HealthServicesManager.kt#L150-L154

Also https://developer.android.com/reference/androidx/health/services/client/ExerciseClient#prepareExerciseAsync(androidx.health.services.client.data.WarmUpConfig)

> 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.

This logging of the error doesn't show a realistic example, and would silently fail without telling the user.

Contributor guide

Open the contributing guide

Research direction

Start with HealthServicesManager.kt at lines 150-154 and compare the current logging with the prepareExerciseAsync reference. Determine how failures from an active exercise or missing permissions should be surfaced to the user; done means the failure is not silently logged and provides a realistic error indication.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.