mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-26 16:41:43 +01:00
Merge pull request #315 from AnotherStranger/master
MusicPlayBackReceiver set track, artist and album to the artist membe…
This commit is contained in:
commit
145dbeedfa
@ -3,6 +3,7 @@ package nodomain.freeyourgadget.gadgetbridge.externalevents;
|
|||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -18,20 +19,13 @@ public class MusicPlaybackReceiver extends BroadcastReceiver {
|
|||||||
String artist = intent.getStringExtra("artist");
|
String artist = intent.getStringExtra("artist");
|
||||||
String album = intent.getStringExtra("album");
|
String album = intent.getStringExtra("album");
|
||||||
String track = intent.getStringExtra("track");
|
String track = intent.getStringExtra("track");
|
||||||
/*
|
|
||||||
Bundle bundle = intent.getExtras();
|
|
||||||
for (String key : bundle.keySet()) {
|
|
||||||
Object value = bundle.get(key);
|
|
||||||
LOG.info(String.format("%s %s (%s)", key,
|
|
||||||
value != null ? value.toString() : "null", value != null ? value.getClass().getName() : "no class"));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
LOG.info("Current track: " + artist + ", " + album + ", " + track);
|
LOG.info("Current track: " + artist + ", " + album + ", " + track);
|
||||||
|
|
||||||
MusicSpec musicSpec = new MusicSpec();
|
MusicSpec musicSpec = new MusicSpec();
|
||||||
musicSpec.artist = artist;
|
musicSpec.artist = artist;
|
||||||
musicSpec.artist = album;
|
musicSpec.album = album;
|
||||||
musicSpec.artist = track;
|
musicSpec.track = track;
|
||||||
|
|
||||||
GBApplication.deviceService().onSetMusicInfo(musicSpec);
|
GBApplication.deviceService().onSetMusicInfo(musicSpec);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user