mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Xiaomi: Further sleep parsing fix
This commit is contained in:
parent
b0ff9eae88
commit
cf0e8be816
@ -85,7 +85,10 @@ public class SleepDetailsParser extends XiaomiActivityParser {
|
|||||||
final int count = buf.getShort();
|
final int count = buf.getShort();
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
// If version is less than 2 firstRecordTime is bedTime
|
||||||
|
if (fileId.getVersion() >= 2) {
|
||||||
final int firstRecordTime = buf.getInt();
|
final int firstRecordTime = buf.getInt();
|
||||||
|
}
|
||||||
|
|
||||||
// Skip count samples - each sample is a u8
|
// Skip count samples - each sample is a u8
|
||||||
// timestamp of each sample is firstRecordTime + (unit * index)
|
// timestamp of each sample is firstRecordTime + (unit * index)
|
||||||
@ -99,7 +102,10 @@ public class SleepDetailsParser extends XiaomiActivityParser {
|
|||||||
final int count = buf.getShort();
|
final int count = buf.getShort();
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
// If version is less than 2 firstRecordTime is bedTime
|
||||||
|
if (fileId.getVersion() >= 2) {
|
||||||
final int firstRecordTime = buf.getInt();
|
final int firstRecordTime = buf.getInt();
|
||||||
|
}
|
||||||
|
|
||||||
// Skip count samples - each sample is a u8
|
// Skip count samples - each sample is a u8
|
||||||
// timestamp of each sample is firstRecordTime + (unit * index)
|
// timestamp of each sample is firstRecordTime + (unit * index)
|
||||||
@ -113,7 +119,10 @@ public class SleepDetailsParser extends XiaomiActivityParser {
|
|||||||
final int count = buf.getShort();
|
final int count = buf.getShort();
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
// If version is less than 2 firstRecordTime is bedTime
|
||||||
|
if (fileId.getVersion() >= 2) {
|
||||||
final int firstRecordTime = buf.getInt();
|
final int firstRecordTime = buf.getInt();
|
||||||
|
}
|
||||||
|
|
||||||
// Skip count samples - each sample is a float
|
// Skip count samples - each sample is a float
|
||||||
// timestamp of each sample is firstRecordTime + (unit * index)
|
// timestamp of each sample is firstRecordTime + (unit * index)
|
||||||
|
Loading…
Reference in New Issue
Block a user