1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-03 17:02:13 +01:00

Xiaomi: Further sleep parsing fix

This commit is contained in:
opcode 2024-01-27 09:10:28 +01:00 committed by José Rebelo
parent b0ff9eae88
commit cf0e8be816

View File

@ -85,7 +85,10 @@ public class SleepDetailsParser extends XiaomiActivityParser {
final int count = buf.getShort();
if (count > 0) {
// If version is less than 2 firstRecordTime is bedTime
if (fileId.getVersion() >= 2) {
final int firstRecordTime = buf.getInt();
}
// Skip count samples - each sample is a u8
// timestamp of each sample is firstRecordTime + (unit * index)
@ -99,7 +102,10 @@ public class SleepDetailsParser extends XiaomiActivityParser {
final int count = buf.getShort();
if (count > 0) {
// If version is less than 2 firstRecordTime is bedTime
if (fileId.getVersion() >= 2) {
final int firstRecordTime = buf.getInt();
}
// Skip count samples - each sample is a u8
// timestamp of each sample is firstRecordTime + (unit * index)
@ -113,7 +119,10 @@ public class SleepDetailsParser extends XiaomiActivityParser {
final int count = buf.getShort();
if (count > 0) {
// If version is less than 2 firstRecordTime is bedTime
if (fileId.getVersion() >= 2) {
final int firstRecordTime = buf.getInt();
}
// Skip count samples - each sample is a float
// timestamp of each sample is firstRecordTime + (unit * index)