diff --git a/CHANGELOG.md b/CHANGELOG.md index 3852e35db..e6977a854 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Pebble: Store app details in pbw-cache and display them in app manager on firmware 3.x * Pebble: Increase maximum notification body length from 255 to 512 bytes on firmware 3.x * Pebble: Support installing .pbl (language files) on firmware 3.x +* Pebble: Correct setting the timezone on firmware 3.x (pebble expects the "ID" eg. Europe/Berlin) ####Version 0.6.8 * Mi Band support for Firmware upgrade/downgrade on Mi Band 1A (white LEDs, no heartrate sensor) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java index 390da759b..7b52a3723 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java @@ -439,8 +439,8 @@ public class PebbleProtocol extends GBDeviceProtocol { long ts_offset = (SimpleTimeZone.getDefault().getOffset(ts)); ByteBuffer buf; if (isFw3x) { - String timezone = SimpleTimeZone.getDefault().getDisplayName(false, SimpleTimeZone.SHORT); - short length = (short) (LENGTH_SETTIME + timezone.length() + 3); + String timezone = SimpleTimeZone.getDefault().getID(); + short length = (short) (LENGTH_SETTIME + timezone.getBytes().length + 3); buf = ByteBuffer.allocate(LENGTH_PREFIX + length); buf.order(ByteOrder.BIG_ENDIAN); buf.putShort(length); @@ -448,7 +448,7 @@ public class PebbleProtocol extends GBDeviceProtocol { buf.put(TIME_SETTIME_UTC); buf.putInt((int) (ts / 1000)); buf.putShort((short) (ts_offset / 60000)); - buf.put((byte) timezone.length()); + buf.put((byte) timezone.getBytes().length); buf.put(timezone.getBytes()); LOG.info(timezone); } else {