From a58e3f66ce2320d2a850af5e3579d3ef4a0ef989 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 5 Nov 2017 22:35:28 +0100 Subject: [PATCH] try to parse timezone that comes back from huami devices (there are other places where something like this has to be done, probably also in the other direction) related to #869 --- .../gadgetbridge/service/btle/BLETypeConversions.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BLETypeConversions.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BLETypeConversions.java index d09e8ad51..71dff949c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BLETypeConversions.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BLETypeConversions.java @@ -147,6 +147,12 @@ public class BLETypeConversions { value[6] & 0xff ); + if (value.length > 7) { + TimeZone timeZone = TimeZone.getDefault(); + timeZone.setRawOffset(value[7] * 15 * 60 * 1000); + timestamp.setTimeZone(timeZone); + } + if (honorDeviceTimeOffset) { int offsetInHours = MiBandCoordinator.getDeviceTimeOffsetHours(); if (offsetInHours != 0) {