Free as in Freedom: Codeberg.org. Create your repos!
Browse Source

add ignoring calls support to Amazfit Bip (probably Cor also and maybe Mi Band 3)

tags/0.34.0
Andreas Shimokawa 1 month ago
parent
commit
12e16ac04a

+ 5
- 4
app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java View File

@@ -1056,7 +1056,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
1056 1056
         currentButtonPressTime = System.currentTimeMillis();
1057 1057
     }
1058 1058
 
1059
-    public void handleDeviceEvent(byte[] value) {
1059
+    private void handleDeviceEvent(byte[] value) {
1060 1060
         if (value == null || value.length == 0) {
1061 1061
             return;
1062 1062
         }
@@ -1064,13 +1064,14 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
1064 1064
 
1065 1065
         switch (value[0]) {
1066 1066
             case HuamiDeviceEvent.CALL_REJECT:
1067
+                LOG.info("call rejected");
1067 1068
                 callCmd.event = GBDeviceEventCallControl.Event.REJECT;
1068 1069
                 evaluateGBDeviceEvent(callCmd);
1069 1070
                 break;
1070 1071
             case HuamiDeviceEvent.CALL_IGNORE:
1071
-                LOG.info("ignore call (not yet supported)");
1072
-                //callCmd.event = GBDeviceEventCallControl.Event.IGNORE;
1073
-                //evaluateGBDeviceEvent(callCmd);
1072
+                LOG.info("call ignored");
1073
+                callCmd.event = GBDeviceEventCallControl.Event.IGNORE;
1074
+                evaluateGBDeviceEvent(callCmd);
1074 1075
                 break;
1075 1076
             case HuamiDeviceEvent.BUTTON_PRESSED:
1076 1077
                 LOG.info("button pressed");

Loading…
Cancel
Save