Add supportsActivityDistance coordinator capability flag following the
supportsActiveCalories pattern. When true, DistanceSyncer syncs all
per-minute distance and RecordedWorkoutSyncer skips DistanceRecords.
Enabled for Garmin (watch + bike), Xiaomi, and Huawei. Other devices
with distance fields (CMF, Colmi, H+, etc.) left at default false
until per-minute data quality is verified.
Syncs device-reported distance (distanceCm) from ActivitySamples to
Health Connect DistanceRecord. Only writes actual device measurements,
skips NOT_MEASURED or zero values.
Sleep sessions that grow over time (partial data synced mid-sleep, full
data available after waking) were permanently stuck as partial records
in Health Connect. The sync cursor advanced past the session's start
after the first sync, so the full session was never re-processed.
Fix with two mechanisms:
- Set clientRecordId per sleep session (deterministic from device +
start hour) with clientRecordVersion = stage count, enabling HC's
native upsert: re-inserting the same session replaces partial data
with the full record.
- Hold the sync cursor behind sessions that ended less than 6 hours
ago (likely still in-progress), so they get re-processed on the
next sync with more complete data.
Replace single sync-time ZoneOffset with ZoneId, resolving the correct
offset per record timestamp via ZoneId.rules.getOffset(instant). Fixes
wrong offset metadata on records crossing DST boundaries (e.g. sleep
sessions starting in CET and ending in CEST).
Also fixes leading space in device model name after manufacturer prefix
strip.