1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 10:35:50 +01:00

Merge branch 'master' into feature-weather

This commit is contained in:
Andreas Shimokawa 2016-12-27 13:51:39 +01:00
commit bcb522d2d0
2 changed files with 8 additions and 1 deletions

View File

@ -29,7 +29,13 @@ public class MusicPlaybackReceiver extends BroadcastReceiver {
MusicSpec musicSpec = new MusicSpec(); MusicSpec musicSpec = new MusicSpec();
musicSpec.artist = intent.getStringExtra("artist"); musicSpec.artist = intent.getStringExtra("artist");
musicSpec.album = intent.getStringExtra("album"); musicSpec.album = intent.getStringExtra("album");
if (intent.hasExtra("track")) {
musicSpec.track = intent.getStringExtra("track"); musicSpec.track = intent.getStringExtra("track");
}
else if (intent.hasExtra("title")) {
musicSpec.track = intent.getStringExtra("title");
}
musicSpec.duration = intent.getIntExtra("duration", 0) / 1000; musicSpec.duration = intent.getIntExtra("duration", 0) / 1000;
if (!lastMusicSpec.equals(musicSpec)) { if (!lastMusicSpec.equals(musicSpec)) {

View File

@ -576,6 +576,7 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
mMusicPlaybackReceiver = new MusicPlaybackReceiver(); mMusicPlaybackReceiver = new MusicPlaybackReceiver();
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
filter.addAction("com.android.music.metachanged"); filter.addAction("com.android.music.metachanged");
filter.addAction("net.sourceforge.subsonic.androidapp.EVENT_META_CHANGED");
//filter.addAction("com.android.music.playstatechanged"); //filter.addAction("com.android.music.playstatechanged");
registerReceiver(mMusicPlaybackReceiver, filter); registerReceiver(mMusicPlaybackReceiver, filter);
} }