1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 18:45:49 +01:00

Xiaomi: Fix persisting unknown workouts

This commit is contained in:
José Rebelo 2024-01-03 21:37:27 +00:00
parent 951d8f25b7
commit 932ec8336c

View File

@ -50,6 +50,8 @@ public class WorkoutSummaryParser extends XiaomiActivityParser implements Activi
BaseActivitySummary summary = new BaseActivitySummary(); BaseActivitySummary summary = new BaseActivitySummary();
summary.setStartTime(fileId.getTimestamp()); // due to a bug this has to be set 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)); summary.setRawSummaryData(ArrayUtils.addAll(fileId.toBytes(), bytes));
try { try {
@ -62,6 +64,7 @@ public class WorkoutSummaryParser extends XiaomiActivityParser implements Activi
// parseBinaryData may return null in case the version is not supported // parseBinaryData may return null in case the version is not supported
if (summary == null) { if (summary == null) {
LOG.warn("summary is null - should never happen {}", fileId);
return false; return false;
} }