feat(04-01): add timestamp to ProcessedGpsData and precision/lifecycle constants

- Add timestamp field to ProcessedGpsData with copyWith support
- Add precision switching thresholds: 3.33 m/s (12 km/h) up, 2.22 m/s (8 km/h) down
- Add PRECISION_SWITCH_FIRST_FIX_DELAY (5s) to prevent early switching
- Add BACKGROUND_GRACE_PERIOD (7s) for lifecycle-aware GPS management
- Mark GPS_GRACE_PERIOD as deprecated in favor of BACKGROUND_GRACE_PERIOD
- Change GpsService.positionStream to createPositionStream() with dynamic accuracy
- Keep deprecated positionStream getter for backward compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikkeli Matlock
2026-02-12 09:00:10 +09:00
parent 40c74677be
commit c4d4032b6b
4 changed files with 29 additions and 3 deletions
+4
View File
@@ -15,5 +15,9 @@ abstract class TimingConfig {
static const Duration LONG_PRESS_SIGNAL_DELAY = Duration(milliseconds: 50);
/// GPS grace period - continues for 30s after overlay close when backgrounded
/// DEPRECATED: Replaced by BACKGROUND_GRACE_PERIOD (7s) for lifecycle management
static const Duration GPS_GRACE_PERIOD = Duration(seconds: 30);
/// Background grace period - time before GPS stops when app backgrounded without overlay
static const Duration BACKGROUND_GRACE_PERIOD = Duration(seconds: 7);
}