From 0470731e4bbd2737e0f5a3dfd1562ea4efa4e199 Mon Sep 17 00:00:00 2001 From: Steffen Liebergeld Date: Wed, 8 Jun 2016 20:16:28 +0200 Subject: [PATCH] PebbleProtocol: Do not call encodeSetMusicState in encodeSetMusicInfo encodeSetMusicState will be accessible on its own. If it was used to set the music state, a call to encodeSetMusicInfo must not reset this info arbitrarily. --- .../gadgetbridge/service/devices/pebble/PebbleProtocol.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java index 6938c45c..33397145 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java @@ -1126,7 +1126,6 @@ public class PebbleProtocol extends GBDeviceProtocol { if (duration == 0) { return encodeMessage(ENDPOINT_MUSICCONTROL, MUSICCONTROL_SETMUSICINFO, 0, parts); } else { - byte[] stateMessage = encodeSetMusicState(MUSICCONTROL_STATE_PLAYING, 0, 100, (byte) 1, (byte) 1); // Calculate length first int length = LENGTH_PREFIX + 9; if (parts != null) { @@ -1140,7 +1139,7 @@ public class PebbleProtocol extends GBDeviceProtocol { } // Encode Prefix - ByteBuffer buf = ByteBuffer.allocate(length + stateMessage.length); + ByteBuffer buf = ByteBuffer.allocate(length); buf.order(ByteOrder.BIG_ENDIAN); buf.putShort((short) (length - LENGTH_PREFIX)); buf.putShort(ENDPOINT_MUSICCONTROL); @@ -1164,8 +1163,6 @@ public class PebbleProtocol extends GBDeviceProtocol { buf.putShort((short) (trackCount & 0xffff)); buf.putShort((short) (trackNr & 0xffff)); - buf.put(stateMessage); - return buf.array(); } }