1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-29 05:16:51 +01:00

Merge branch 'master' of codeberg.org:Freeyourgadget/Gadgetbridge

This commit is contained in:
Gordon Williams 2022-05-25 13:28:35 +01:00
commit f96d413d96
8 changed files with 28 additions and 17 deletions

View File

@ -1,5 +1,8 @@
### Changelog
### NEXT
* Amazfit Bip U/Pro/Band 5: enable extended HR/stress monitoring setting
### 0.67.0
* Initial Support for Sony WF-1000XM3
* Initial Support for Galaxy Buds Pro

View File

@ -101,7 +101,7 @@ public class AmazfitBand5Coordinator extends HuamiCoordinator {
R.xml.devicesettings_amazfitband5,
R.xml.devicesettings_vibrationpatterns,
R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_timeformat,

View File

@ -112,7 +112,7 @@ public class AmazfitBipUCoordinator extends HuamiCoordinator {
R.xml.devicesettings_timeformat,
R.xml.devicesettings_world_clocks,
R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display_sensitivity,

View File

@ -111,7 +111,7 @@ public class AmazfitBipUProCoordinator extends HuamiCoordinator {
R.xml.devicesettings_timeformat,
R.xml.devicesettings_world_clocks,
R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display_sensitivity,

View File

@ -106,7 +106,7 @@ public class MiBand5Coordinator extends HuamiCoordinator {
R.xml.devicesettings_miband5,
R.xml.devicesettings_vibrationpatterns,
R.xml.devicesettings_wearlocation,
R.xml.heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_timeformat,

View File

@ -86,7 +86,7 @@ public class MiBand6Coordinator extends HuamiCoordinator {
R.xml.devicesettings_miband6,
R.xml.devicesettings_vibrationpatterns,
R.xml.devicesettings_wearlocation,
R.xml.heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_timeformat,

View File

@ -1339,20 +1339,28 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
return;
}
String artist = "";
String album = "";
String track = "";
byte flags = 0x00;
flags |= 0x01;
int length = 5;
if (musicSpec != null) {
if (musicSpec.artist != null && musicSpec.artist.getBytes().length > 0) {
length += musicSpec.artist.getBytes().length + 1;
artist = StringUtils.truncate(musicSpec.artist, 80);
album = StringUtils.truncate(musicSpec.album, 80);
track = StringUtils.truncate(musicSpec.album, 80);
if (artist.getBytes().length > 0) {
length += artist.getBytes().length + 1;
flags |= 0x02;
}
if (musicSpec.album != null && musicSpec.album.getBytes().length > 0) {
length += musicSpec.album.getBytes().length + 1;
if (album.getBytes().length > 0) {
length += album.getBytes().length + 1;
flags |= 0x04;
}
if (musicSpec.track != null && musicSpec.track.getBytes().length > 0) {
length += musicSpec.track.getBytes().length + 1;
if (track.getBytes().length > 0) {
length += track.getBytes().length + 1;
flags |= 0x08;
}
if (musicSpec.duration != 0) {
@ -1379,16 +1387,16 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
buf.putShort((short) musicStateSpec.position);
if (musicSpec != null) {
if (musicSpec.artist != null && musicSpec.artist.getBytes().length > 0) {
buf.put(musicSpec.artist.getBytes());
if (artist.getBytes().length > 0) {
buf.put(artist.getBytes());
buf.put((byte) 0);
}
if (musicSpec.album != null && musicSpec.album.getBytes().length > 0) {
buf.put(musicSpec.album.getBytes());
if (album.getBytes().length > 0) {
buf.put(album.getBytes());
buf.put((byte) 0);
}
if (musicSpec.track != null && musicSpec.track.getBytes().length > 0) {
buf.put(musicSpec.track.getBytes());
if (track.getBytes().length > 0) {
buf.put(track.getBytes());
buf.put((byte) 0);
}
if (musicSpec.duration != 0) {