mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
"duration" parameter in onSetMusicInfo uses microseconds
This is in line with Android, and saves some calculations (and thereby a tiny little bit of battery life).
This commit is contained in:
parent
fb71cdf55b
commit
204748c518
@ -218,7 +218,7 @@ public class DebugActivity extends GBActivity {
|
||||
musicSpec.artist = editContent.getText().toString() + "(artist)";
|
||||
musicSpec.album = editContent.getText().toString() + "(album)";
|
||||
musicSpec.track = editContent.getText().toString() + "(track)";
|
||||
musicSpec.duration = 10;
|
||||
musicSpec.duration = 10 * 1000;
|
||||
musicSpec.trackCount = 5;
|
||||
musicSpec.trackNr = 2;
|
||||
|
||||
|
@ -380,7 +380,7 @@ public class NotificationListener extends NotificationListenerService {
|
||||
if (d.containsKey(MediaMetadata.METADATA_KEY_TITLE))
|
||||
musicSpec.track = d.getString(MediaMetadata.METADATA_KEY_TITLE);
|
||||
if (d.containsKey(MediaMetadata.METADATA_KEY_DURATION))
|
||||
musicSpec.duration = (int)d.getLong(MediaMetadata.METADATA_KEY_DURATION) / 1000;
|
||||
musicSpec.duration = (int)d.getLong(MediaMetadata.METADATA_KEY_DURATION);
|
||||
|
||||
// finally, tell the device about it
|
||||
GBApplication.deviceService().onSetMusicInfo(musicSpec);
|
||||
|
@ -1159,7 +1159,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||
}
|
||||
|
||||
buf.order(ByteOrder.LITTLE_ENDIAN);
|
||||
buf.putInt(duration * 1000);
|
||||
buf.putInt(duration);
|
||||
buf.putShort((short) (trackCount & 0xffff));
|
||||
buf.putShort((short) (trackNr & 0xffff));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user