mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-27 12:26:48 +01:00
Merge pull request #60 from danielegobbetti/fix_data_in_the_future
Do not allocate the buffer if there's no data available.
This commit is contained in:
commit
32b2500d6b
@ -462,8 +462,10 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||
LOG.info("data to read until next header: "+ dataUntilNextHeader +" len: " + (dataUntilNextHeader / 3) + " minute(s)");
|
||||
LOG.info("TIMESTAMP: " + DateFormat.getDateTimeInstance().format(timestamp.getTime()).toString() + " magic byte: " + dataUntilNextHeader);
|
||||
|
||||
this.activityDataRemainingBytes = this.activityDataUntilNextHeader = dataUntilNextHeader;
|
||||
this.activityDataTimestampProgress = this.activityDataTimestampToAck = timestamp;
|
||||
if (dataUntilNextHeader > 0 ) { //tentative fix for data in the future
|
||||
this.activityDataRemainingBytes = this.activityDataUntilNextHeader = dataUntilNextHeader;
|
||||
this.activityDataTimestampProgress = this.activityDataTimestampToAck = timestamp;
|
||||
}
|
||||
|
||||
} else {
|
||||
bufferActivityData(value);
|
||||
|
Loading…
Reference in New Issue
Block a user