mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Fossil Q: Fix steps detection during increased activity
This commit is contained in:
committed by
Arjan Schrijver
parent
79363b0cbb
commit
4083d181a6
+5
-12
@@ -91,13 +91,7 @@ public class ActivityFileParser {
|
|||||||
int hrByte = file[pos + 2] & 0xFF;
|
int hrByte = file[pos + 2] & 0xFF;
|
||||||
int flags = file[pos + 3] & 0xFF;
|
int flags = file[pos + 3] & 0xFF;
|
||||||
|
|
||||||
if (hrByte != 0xFF) break; // sentinel / corrupt record → stop
|
if (hrByte != 0xFF) break; // not a known no-HR record
|
||||||
|
|
||||||
if ((flags & 0x40) != 0) { // special marker → skip, tick clock
|
|
||||||
currentTimestamp += 60;
|
|
||||||
pos += 4;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ActivityEntry entry = new ActivityEntry();
|
ActivityEntry entry = new ActivityEntry();
|
||||||
entry.id = currentId++;
|
entry.id = currentId++;
|
||||||
@@ -106,11 +100,10 @@ public class ActivityFileParser {
|
|||||||
|
|
||||||
parseVariabilityBytes(varLo, varHi, entry);
|
parseVariabilityBytes(varLo, varHi, entry);
|
||||||
|
|
||||||
int intensity = flags & 0x03;
|
entry.isActive = (flags & 0x40) == 0x40;
|
||||||
entry.isActive = intensity > 0;
|
int calories = flags & 0xFF;
|
||||||
// intensity 0=none, 1=light, 2=moderate, 3=vigorous
|
calories &= 0x3F;
|
||||||
// stored in calories field for compatibility (0–3)
|
entry.calories = calories;
|
||||||
// entry.calories = intensity;
|
|
||||||
|
|
||||||
samples.add(entry);
|
samples.add(entry);
|
||||||
currentTimestamp += 60;
|
currentTimestamp += 60;
|
||||||
|
|||||||
Reference in New Issue
Block a user