1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 20:36:51 +01:00

Revert ""duration" parameter in onSetMusicInfo uses microseconds"

The decision on granularity of APIs is up to the maintainers.

This reverts commit 204748c518.
This commit is contained in:
Steffen Liebergeld 2016-06-09 20:02:01 +02:00
parent 204748c518
commit 91f374edec
3 changed files with 3 additions and 3 deletions

View File

@ -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 * 1000;
musicSpec.duration = 10;
musicSpec.trackCount = 5;
musicSpec.trackNr = 2;

View File

@ -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);
musicSpec.duration = (int)d.getLong(MediaMetadata.METADATA_KEY_DURATION) / 1000;
// finally, tell the device about it
GBApplication.deviceService().onSetMusicInfo(musicSpec);

View File

@ -1159,7 +1159,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
}
buf.order(ByteOrder.LITTLE_ENDIAN);
buf.putInt(duration);
buf.putInt(duration * 1000);
buf.putShort((short) (trackCount & 0xffff));
buf.putShort((short) (trackNr & 0xffff));