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 034484cb2..c1727800a 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 @@ -842,7 +842,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport { sendMusicStateToDevice(bufferMusicSpec, bufferMusicStateSpec); } - private void sendMusicStateToDevice(MusicSpec musicSpec, MusicStateSpec musicStateSpec) { + protected void sendMusicStateToDevice(MusicSpec musicSpec, MusicStateSpec musicStateSpec) { if (characteristicChunked == null) { return; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitcor/AmazfitCorSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitcor/AmazfitCorSupport.java index 1ccbe9484..1786053ce 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitcor/AmazfitCorSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitcor/AmazfitCorSupport.java @@ -35,6 +35,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiService; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcor.AmazfitCorFWHelper; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitcor.AmazfitCorService; +import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec; import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitbip.AmazfitBipSupport; @@ -85,6 +86,14 @@ public class AmazfitCorSupport extends AmazfitBipSupport { return this; } + @Override + public void onSetMusicState(MusicStateSpec stateSpec) { + if (stateSpec != null && !stateSpec.equals(bufferMusicStateSpec)) { + sendMusicStateToDevice(null, stateSpec); + bufferMusicStateSpec = stateSpec; + } + } + @Override public HuamiFWHelper createFWHelper(Uri uri, Context context) throws IOException { return new AmazfitCorFWHelper(uri, context);