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.
This commit is contained in:
Andreas Shimokawa 2015-03-07 14:40:59 +01:00
parent e52e26168a
commit 4e7553836b
1 changed files with 13 additions and 2 deletions

View File

@ -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;
}