Add isEmpty() call to Song
This commit is contained in:
parent
e4855e51eb
commit
052365c872
@ -423,7 +423,7 @@ public class MediaUtils {
|
||||
}
|
||||
cursor.close();
|
||||
}
|
||||
return song.id == -1 ? null : song;
|
||||
return song.isEmpty() ? null : song;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1279,7 +1279,7 @@ public final class PlaybackService extends Service
|
||||
else
|
||||
song = mTimeline.shiftCurrentSong(delta);
|
||||
mCurrentSong = song;
|
||||
if (song == null || song.id == -1 || song.path == null) {
|
||||
if (song == null || song.isEmpty()) {
|
||||
if (MediaUtils.isSongAvailable(getContentResolver())) {
|
||||
int flag = finishAction(mState) == SongTimeline.FINISH_RANDOM ? FLAG_ERROR : FLAG_EMPTY_QUEUE;
|
||||
synchronized (mStateLock) {
|
||||
|
@ -87,7 +87,7 @@ public class RemoteControl {
|
||||
|
||||
remote.setPlaybackState(isPlaying ? RemoteControlClient.PLAYSTATE_PLAYING : RemoteControlClient.PLAYSTATE_PAUSED);
|
||||
RemoteControlClient.MetadataEditor editor = remote.editMetadata(true);
|
||||
if (song != null && song.id != -1) {
|
||||
if (song != null && song.isEmpty() == false) {
|
||||
editor.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, song.artist);
|
||||
editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, song.album);
|
||||
editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, song.title);
|
||||
|
Loading…
x
Reference in New Issue
Block a user