1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-24 22:10:55 +02:00

Xiaomi: Ack activity before parsing for now

This commit is contained in:
José Rebelo 2023-10-18 17:01:42 +01:00
parent afaf0baa79
commit 5dd746f2d6

View File

@ -109,6 +109,12 @@ public class XiaomiActivityFileFetcher {
dumpBytesToExternalStorage(fileId, data); dumpBytesToExternalStorage(fileId, data);
} }
if (!XiaomiPreferences.keepActivityDataOnDevice(mHealthService.getSupport().getDevice())) {
LOG.debug("Acking recorded data {}", fileId);
// TODO is this too early?
mHealthService.ackRecordedData(fileId);
}
final XiaomiActivityParser activityParser = XiaomiActivityParser.create(fileId); final XiaomiActivityParser activityParser = XiaomiActivityParser.create(fileId);
if (activityParser == null) { if (activityParser == null) {
LOG.warn("Failed to find activity parser for {}", fileId); LOG.warn("Failed to find activity parser for {}", fileId);
@ -116,11 +122,8 @@ public class XiaomiActivityFileFetcher {
return; return;
} }
if (activityParser.parse(mHealthService.getSupport(), fileId, activityData)) { if (!activityParser.parse(mHealthService.getSupport(), fileId, activityData)) {
if (!XiaomiPreferences.keepActivityDataOnDevice(mHealthService.getSupport().getDevice())) { LOG.warn("Failed to parse {}", fileId);
LOG.debug("Acking recorded data {}", fileId);
mHealthService.ackRecordedData(fileId);
}
} }
triggerNextFetch(); triggerNextFetch();