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 flags = file[pos + 3] & 0xFF;
|
||||
|
||||
if (hrByte != 0xFF) break; // sentinel / corrupt record → stop
|
||||
|
||||
if ((flags & 0x40) != 0) { // special marker → skip, tick clock
|
||||
currentTimestamp += 60;
|
||||
pos += 4;
|
||||
continue;
|
||||
}
|
||||
if (hrByte != 0xFF) break; // not a known no-HR record
|
||||
|
||||
ActivityEntry entry = new ActivityEntry();
|
||||
entry.id = currentId++;
|
||||
@@ -106,11 +100,10 @@ public class ActivityFileParser {
|
||||
|
||||
parseVariabilityBytes(varLo, varHi, entry);
|
||||
|
||||
int intensity = flags & 0x03;
|
||||
entry.isActive = intensity > 0;
|
||||
// intensity 0=none, 1=light, 2=moderate, 3=vigorous
|
||||
// stored in calories field for compatibility (0–3)
|
||||
// entry.calories = intensity;
|
||||
entry.isActive = (flags & 0x40) == 0x40;
|
||||
int calories = flags & 0xFF;
|
||||
calories &= 0x3F;
|
||||
entry.calories = calories;
|
||||
|
||||
samples.add(entry);
|
||||
currentTimestamp += 60;
|
||||
|
||||
Reference in New Issue
Block a user