Commit Graph
7 Commits
Author SHA1 Message Date
Ingvar StepanyanandJosé Rebelo 9229239e7e Address review comments 2026-06-06 21:26:51 +02:00
Ingvar StepanyanandJosé Rebelo 3d48db83c9 Garmin: fix transfer notification leaks and stray pre-start posts
Three lifecycle bugs in GarminSupport's transferNotification:

* addFileToDownloadList incremented totalSize unconditionally, so a directory listing arriving on connect posted a notification with the unlocalised "Unknown transfer" fallback title before any transfer started.

* The start/finish pair gated on gbDevice.isBusy(), which other paths set and clear — start could be skipped while the matching finish ran anyway, or vice versa.

* dispose() didn't finish the notification, leaving it pinned after a mid-sync disconnect.

Gate the increments and the start/finish pair on the private isBusyFetching flag, and finish + clear the flag in dispose().
2026-06-06 21:26:51 +02:00
Ingvar StepanyanandJosé Rebelo 3b9b4126ba Workout list: live-refresh on ACTION_NEW_DATA without blink
Long-running per-line fetches (e.g. ExploreSync's catalog walk) hold the device's busy task for the entire session, so the busy→idle edge WorkoutListActivity refreshes on only fires at session end. Listen for ACTION_NEW_DATA too so each newly imported activity appears as it lands.

Add a silent loadSummaries path that skips the isLoading flips, and disable the RecyclerView change animator so the dashboard row's notifyItemChanged(0) doesn't cross-fade — both would otherwise read as a distracting blink during an active sync.
2026-06-06 21:26:51 +02:00
Ingvar StepanyanandJosé Rebelo c1946573fb Garmin: ExploreSync historical activity import
Wires the new ExploreSync sub-service into ProtocolBufferHandler and GarminSupport so a paired device's historical-line catalog can be fetched independently of FIT — which Garmin Connect Mobile irreversibly archives files out of after the first sync (see issues like #5694 and #5994). Activities the FIT path can no longer see become visible again here.

Each historical line is reconstructed into an ActivityTrack, written as GPX, and persisted as a BaseActivitySummary keyed on the first-point timestamp — the same surface FIT-imported workouts use, so UI and exporters need no ExploreSync awareness. GarminCoordinator now picks the activity track provider from the summary contents (gpxTrack vs rawDetailsPath) instead of hard-coding the FIT one.
2026-06-06 21:26:51 +02:00
Ingvar StepanyanandJosé Rebelo 1cfcd0772c Garmin: extract buildExportPath helper in GarminUtils
Three call sites (FileTransferHandler, FitImporter, GarminSupport) each open-coded the same [TYPE]/[YEAR]/[TYPE]_[timestamp]_[suffix] filename shape and re-created their own SimpleDateFormat. Hoist the formatters (now thread-safe DateTimeFormatter) and the path builder into GarminUtils as buildExportPath(type, instant, suffix, ext).

FitImporter's null-type fallback now uses "NULL" consistently for both directory and filename, fixing a latent NPE.
2026-06-06 21:26:51 +02:00
Ingvar StepanyanandJosé Rebelo 5b375b2bb8 Garmin: extract sendProtobufRequest helper
Every watch-bound Smart RPC site followed the same shape: sendOutgoingMessage(taskName, protocolBufferHandler.prepareProtobufRequest(payload)). Fold it into a single sendProtobufRequest(taskName, payload) on GarminSupport. No behaviour change.
2026-06-06 21:26:51 +02:00
Ingvar StepanyanandJosé Rebelo 32a18d8d81 Garmin: deduplicate degrees ↔ semicircles math in GarminUtils
The watch encodes lat/lon as signed 32-bit semicircles (1<<31 == 180°). Move the bidirectional conversion behind named helpers backed by a single constant, and migrate toLocationData and FieldDefinitionCoordinate onto them.
2026-06-06 21:26:51 +02:00