From 12e16ac04a5ccc46ac5baf4482d7702539186bdc Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 25 May 2019 22:19:19 +0200 Subject: [PATCH] add ignoring calls support to Amazfit Bip (probably Cor also and maybe Mi Band 3) --- .../gadgetbridge/service/devices/huami/HuamiSupport.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java index 9657ff0a7..e7b548a27 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java @@ -1056,7 +1056,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport { currentButtonPressTime = System.currentTimeMillis(); } - public void handleDeviceEvent(byte[] value) { + private void handleDeviceEvent(byte[] value) { if (value == null || value.length == 0) { return; } @@ -1064,13 +1064,14 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport { switch (value[0]) { case HuamiDeviceEvent.CALL_REJECT: + LOG.info("call rejected"); callCmd.event = GBDeviceEventCallControl.Event.REJECT; evaluateGBDeviceEvent(callCmd); break; case HuamiDeviceEvent.CALL_IGNORE: - LOG.info("ignore call (not yet supported)"); - //callCmd.event = GBDeviceEventCallControl.Event.IGNORE; - //evaluateGBDeviceEvent(callCmd); + LOG.info("call ignored"); + callCmd.event = GBDeviceEventCallControl.Event.IGNORE; + evaluateGBDeviceEvent(callCmd); break; case HuamiDeviceEvent.BUTTON_PRESSED: LOG.info("button pressed");