mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Garmin: Only trigger ExploreSync after normal sync
This commit is contained in:
+1
-1
@@ -648,7 +648,7 @@ class ExploreSyncHandler {
|
||||
* timestamp, plus per-point HR samples for indoor activities.
|
||||
*/
|
||||
private void flush() throws Exception {
|
||||
if (points.isEmpty()) {
|
||||
if (points.isEmpty() || alreadyImported(points.get(0).getTime().getTime() / 1000L)) {
|
||||
// Upfront skip-check matched in absorb().
|
||||
LOG.info("Historical line {}: skipped (already imported)", uuidHex);
|
||||
return;
|
||||
|
||||
+9
-8
@@ -544,14 +544,6 @@ public class GarminSupport extends AbstractBTLESingleDeviceSupport implements IC
|
||||
// otherwise we might get incomplete monitor files
|
||||
sendOutgoingMessage("fetch recorded data", fileTransferHandler.initiateDownload());
|
||||
|
||||
if (getCoordinator().supports(getDevice(), GarminCapability.EXPLORE_SYNC)) {
|
||||
// Re-arm the ExploreSync historical catalog walk so any activities
|
||||
// recorded since the initial connect get picked up. Watches that
|
||||
// don't support the service reject our StartSyncRequest and the
|
||||
// handler tears the session down on its own.
|
||||
protocolBufferHandler.getExploreSyncHandler().startSession();
|
||||
}
|
||||
|
||||
//TODO: ask the watch to initiate the sync? Something like:
|
||||
// sendOutgoingMessage("set sync ready", new SystemEventMessage(SystemEventMessage.GarminSystemEventType.SYNC_READY, 0));
|
||||
// sendOutgoingMessage("set foreground", new SystemEventMessage(SystemEventMessage.GarminSystemEventType.HOST_DID_ENTER_FOREGROUND, 0));
|
||||
@@ -956,8 +948,17 @@ public class GarminSupport extends AbstractBTLESingleDeviceSupport implements IC
|
||||
}
|
||||
isBusyFetching = false;
|
||||
|
||||
// FIXME: This should probably only happen after exploresync also finishes
|
||||
sendOutgoingMessage("set sync complete", new SystemEventMessage(SystemEventMessage.GarminSystemEventType.SYNC_COMPLETE, 0));
|
||||
|
||||
if (getCoordinator().supports(getDevice(), GarminCapability.EXPLORE_SYNC)) {
|
||||
// Re-arm the ExploreSync historical catalog walk so any activities
|
||||
// recorded since the initial connect get picked up. Watches that
|
||||
// don't support the service reject our StartSyncRequest and the
|
||||
// handler tears the session down on its own.
|
||||
protocolBufferHandler.getExploreSyncHandler().startSession();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user