From f9122bc674bdce0f3b5480a8b6576a3320b62534 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Tue, 29 Dec 2015 10:01:32 +0100 Subject: [PATCH] send the calendar events each time the time is sent to miband, until we have a common strategy (e.g. EventHandler). --- .../gadgetbridge/service/devices/miband/MiBandSupport.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java index fe29943f4..a78b37f86 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java @@ -408,6 +408,8 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { } catch (IOException ex) { LOG.error("Unable to set time on MI device", ex); } + //TODO: once we have a common strategy for sending events (e.g. EventHandler), remove this call from here. Meanwhile it does no harm. + sendCalendarEvents(); } /** @@ -796,7 +798,10 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { LOG.info("MI Band pairing result: " + value); } - private void sendEvents() { + /** + * Fetch the events from the android device calendars and set the alarms on the miband. + */ + private void sendCalendarEvents() { try { TransactionBuilder builder = performInitialized("Send upcoming events"); BluetoothGattCharacteristic characteristic = getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT);