Skip to content

fix(android): map BIKING_STATIONARY for Health Connect workouts#477

Open
georgemac-labs wants to merge 1 commit intocarp-dk:mainfrom
georgemac-labs:fix/android-workout-type-map-parity
Open

fix(android): map BIKING_STATIONARY for Health Connect workouts#477
georgemac-labs wants to merge 1 commit intocarp-dk:mainfrom
georgemac-labs:fix/android-workout-type-map-parity

Conversation

@georgemac-labs
Copy link
Copy Markdown

@georgemac-labs georgemac-labs commented Mar 11, 2026

Summary

Fixes Android Health Connect workout writing for BIKING_STATIONARY.

HealthWorkoutActivityType.BIKING_STATIONARY is exposed in Dart and marked Android-supported,
but native write validation failed with:
[Health Connect] Workout type not supported

Root cause

Android workout writes validate activity type strings against HealthConstants.workoutTypeMap.
BIKING_STATIONARY was missing from that map.

Change

Added one mapping in android/src/main/kotlin/cachet/plugins/health/HealthConstants.kt:

  • BIKING_STATIONARY -> ExerciseSessionRecord.EXERCISE_TYPE_BIKING_STATIONARY

Notes

Other candidate mappings were intentionally not included because this plugin targets an older
Health Connect version where those constants are not available.

Verification

  • Ran flutter analyze.
  • No new analyzer errors from this change (only existing info-level lints in example/test files).

@georgemac-labs georgemac-labs changed the title fix(android): add missing Health Connect workout type mappings fix(android): map BIKING_STATIONARY for Health Connect workouts Mar 11, 2026
@georgemac-labs georgemac-labs force-pushed the fix/android-workout-type-map-parity branch from 70692b7 to d558055 Compare March 11, 2026 22:41
@iarata iarata self-assigned this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants