Fixed notification reappearing if continuous playback is disabled

This commit is contained in:
ByteHamster 2019-10-09 12:26:11 +02:00
parent 3980bcca6d
commit c1d81408c1
1 changed files with 2 additions and 0 deletions

View File

@ -838,6 +838,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
@Override @Override
public void onPlaybackPause(Playable playable, int position) { public void onPlaybackPause(Playable playable, int position) {
taskManager.cancelPositionSaver(); taskManager.cancelPositionSaver();
cancelPositionObserver();
saveCurrentPosition(position == PlaybackServiceMediaPlayer.INVALID_TIME || playable == null, saveCurrentPosition(position == PlaybackServiceMediaPlayer.INVALID_TIME || playable == null,
playable, position); playable, position);
taskManager.cancelWidgetUpdater(); taskManager.cancelWidgetUpdater();
@ -914,6 +915,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
Log.d(TAG, "Playback ended"); Log.d(TAG, "Playback ended");
if (stopPlaying) { if (stopPlaying) {
taskManager.cancelPositionSaver(); taskManager.cancelPositionSaver();
cancelPositionObserver();
PlaybackPreferences.writeNoMediaPlaying(); PlaybackPreferences.writeNoMediaPlaying();
if (!isCasting) { if (!isCasting) {
stateManager.stopForeground(true); stateManager.stopForeground(true);