Files
Gadgetbridge/app/src
Gideon Zenz d4c36e2e36 Health Connect: Exclude bad-measurement sentinels from HR and SpO2 sync
PR #6195 widened the syncer guards to match Health Connect's enforced
bounds, but widened too much: it overlooked that some of Gadgetbridge's
in-band sentinel values fall inside HC's accepted range, so placeholder
readings leaked into Health Connect and showed up as spurious data points.

- HeartRate / RestingHeartRate: 255 is GB's "illegal value" marker for a
  bad measurement (ActivitySample.getHeartRate), and it sits inside HC's
  1..300 / 0..300 range. Exclude it explicitly while keeping HC's bounds.
- SpO2: 0 means "not measured" (sample providers return null on 0 and all
  SpO2 charts filter getSpo2() > 0). Raise the lower bound to 1.

Add HeartRateSyncerTest covering the HeartRateSyncer.sync() path (sentinel
255 and 0 are not inserted; valid range passes) and extend
SyncerRangeValidationTest with the new boundaries.
2026-06-13 11:13:37 +02:00
..