From 932ec8336c1ec7e795d1c06a740679a379f3de97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Wed, 3 Jan 2024 21:37:27 +0000 Subject: [PATCH] Xiaomi: Fix persisting unknown workouts --- .../devices/xiaomi/activity/impl/WorkoutSummaryParser.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/WorkoutSummaryParser.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/WorkoutSummaryParser.java index eb4f82d5b..30c9c0c71 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/WorkoutSummaryParser.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/WorkoutSummaryParser.java @@ -50,6 +50,8 @@ public class WorkoutSummaryParser extends XiaomiActivityParser implements Activi BaseActivitySummary summary = new BaseActivitySummary(); summary.setStartTime(fileId.getTimestamp()); // due to a bug this has to be set + summary.setEndTime(fileId.getTimestamp()); // due to a bug this has to be set + summary.setActivityKind(ActivityKind.TYPE_UNKNOWN); summary.setRawSummaryData(ArrayUtils.addAll(fileId.toBytes(), bytes)); try { @@ -62,6 +64,7 @@ public class WorkoutSummaryParser extends XiaomiActivityParser implements Activi // parseBinaryData may return null in case the version is not supported if (summary == null) { + LOG.warn("summary is null - should never happen {}", fileId); return false; }