| Shape | One 2,355-line Java class | About 20 Kotlin classes: processor, 4 state machines, evaluators, monitors |
| Ordering & concurrency | Hand-built queue paused by lock flags and restarted recursively from callbacks; mixes main Handler, AsyncLoader, coroutines and AlarmManager | One coroutine Channel: engine samples and external inputs (driver change, unresponsive, status change) are processed one at a time, in order |
| State | MotionStatus split across two fields plus many booleans and counters | Tinder state machines (Vehicle, Ignition, DriveTime, Recovery) with explicit events and side effects |
| Why did status change? | Only System vs User record origin | EventOrigin on every event (e.g. DriverUnresponsive, PcDistanceLimitExceeded, YmGeofenceExit); this decides whether On Duty is written |
| Thresholds | Unchanged: ≥5 mph (V2 can be lowered by config), 0 mph for 3 s, 5 min idle, 1 min countdown, US backdates / Canada +6 min |
| Unidentified & S&F | Separate copy-pasted branches; S&F stop decided from timestamps | DriveTimeStateMachine (Unidentified / Driver / Unconfirmed); S&F shortens the alarm by elapsed time; adds DriverUnresponsiveStoreAndForward |
| Hourly intermediate events | Top-of-hour alarm and a separate alarm counting from when the wheels started moving | HeartbeatMonitor: top-of-hour + hourly; alarm times persisted; backfills gaps over a 2-day window after S&F |
| App restart / crash | Re-reads stored motion status | Restores state machines from engine-data snapshots, reschedules remaining alarm time, fires DriverUnresponsiveMissed if an alarm is overdue |
| Data wipe mid-drive | No handling | RecoveryStateMachine suppresses a duplicate power-up and Driving record |
| Dialogs | Alert helper overlays | DriveLogicDialogManager → DriveLogicDialogActivity; answers come back as a flow |
| Observability | Firebase S&F event, invalid_odometer | Structured state machine logs plus StuckInDriveLogger (stuck_in_drive_anomaly, possible_obc_disconnect) |
| Status today | Deleted July 2024 | The only implementation; actively developed (PSELD-*) |