Fixed notification being permanently updated.
This commit is contained in:
parent
5b1b539083
commit
484fbe3bdd
1 changed files with 5 additions and 4 deletions
|
@ -227,6 +227,9 @@ public class MediaRouterPlayService extends Service {
|
||||||
mSessionId = data.getString(MediaControlIntent.EXTRA_SESSION_ID);
|
mSessionId = data.getString(MediaControlIntent.EXTRA_SESSION_ID);
|
||||||
mItemId = data.getString(MediaControlIntent.EXTRA_ITEM_ID);
|
mItemId = data.getString(MediaControlIntent.EXTRA_ITEM_ID);
|
||||||
mPollingStatus = true;
|
mPollingStatus = true;
|
||||||
|
|
||||||
|
new CreateNotificationTask().execute(mPlaylist.get(mCurrentTrack)
|
||||||
|
.getFirstPropertyValue(DIDLObject.Property.UPNP.ALBUM_ART_URI.class));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -307,15 +310,13 @@ public class MediaRouterPlayService extends Service {
|
||||||
@Override
|
@Override
|
||||||
public void onResult(Bundle data) {
|
public void onResult(Bundle data) {
|
||||||
MediaItemStatus status = MediaItemStatus.fromBundle(data);
|
MediaItemStatus status = MediaItemStatus.fromBundle(data);
|
||||||
|
|
||||||
if (mRouterFragment.get() != null)
|
if (mRouterFragment.get() != null)
|
||||||
mRouterFragment.get().receivePlaybackStatus(status);
|
mRouterFragment.get().receivePlaybackStatus(status);
|
||||||
if (status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PENDING &&
|
if (status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PENDING &&
|
||||||
status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_BUFFERING &&
|
status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_BUFFERING &&
|
||||||
status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PLAYING)
|
status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PLAYING)
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
else
|
|
||||||
new CreateNotificationTask().execute(mPlaylist.get(mCurrentTrack)
|
|
||||||
.getFirstPropertyValue(DIDLObject.Property.UPNP.ALBUM_ART_URI.class));
|
|
||||||
|
|
||||||
if (status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED) {
|
if (status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED) {
|
||||||
if (mCurrentTrack + 1 < mPlaylist.size())
|
if (mCurrentTrack + 1 < mPlaylist.size())
|
||||||
|
|
Reference in a new issue