From 4e7553836ba4237d01971422b55c1cd6ae3a4e38 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 7 Mar 2015 14:40:59 +0100 Subject: [PATCH] Workaround for non-working outgoing call display. Fixes #6. This is still a bit ugly because we cannot (yet?) detect whether remote has taken the call or not. So we will start counting in-call time from the moment we start dialling. --- .../gadgetbridge/PebbleProtocol.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/PebbleProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/PebbleProtocol.java index e0876538..6adce189 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/PebbleProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/PebbleProtocol.java @@ -175,8 +175,19 @@ public class PebbleProtocol { pebbleCmd = PHONECONTROL_INCOMINGCALL; break; case CALL_OUTGOING: - pebbleCmd = PHONECONTROL_OUTGOINGCALL; - break; + // pebbleCmd = PHONECONTROL_OUTGOINGCALL; + /* + * HACK/WORKAROUND for non-working outgoing call display. + * Just send a incoming call command immediately followed by a start call command + * This prevents vibration of the Pebble. + */ + byte[] callmsg = encodeMessage(ENDPOINT_PHONECONTROL, PHONECONTROL_INCOMINGCALL, 0, parts); + byte[] startmsg = encodeMessage(ENDPOINT_PHONECONTROL, PHONECONTROL_START, 0, parts); + byte[] msg = new byte[callmsg.length + startmsg.length]; + System.arraycopy(callmsg, 0, msg, 0, callmsg.length); + System.arraycopy(startmsg, 0, msg, startmsg.length, startmsg.length); + return msg; + // END HACK default: return null; }