diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2021-08-28 12:24:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 12:24:47 +0200 |
commit | 96f8cd3793dee82d8a54fdd378861b8849655937 (patch) | |
tree | 3d3b6c89dbf32fd86eea2671957e724a414c7a3c /core | |
parent | 9745a9d130100f316422f66e41f27f9f5732c8b4 (diff) | |
parent | bf58cdc430744e0923c898c75183650429bf1c05 (diff) | |
download | AntennaPod-96f8cd3793dee82d8a54fdd378861b8849655937.zip |
Merge pull request #5364 from ByteHamster/playback-state-fixes
Playback state fixes
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index a54f0679d..f503c16f4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -986,6 +986,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { private Playable getNextInQueue(final Playable currentMedia) { if (!(currentMedia instanceof FeedMedia)) { Log.d(TAG, "getNextInQueue(), but playable not an instance of FeedMedia, so not proceeding"); + PlaybackPreferences.writeNoMediaPlaying(); return null; } Log.d(TAG, "getNextInQueue()"); @@ -996,6 +997,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { FeedItem item = media.getItem(); if (item == null) { Log.w(TAG, "getNextInQueue() with FeedMedia object whose FeedItem is null"); + PlaybackPreferences.writeNoMediaPlaying(); return null; } FeedItem nextItem; @@ -1008,11 +1010,13 @@ public class PlaybackService extends MediaBrowserServiceCompat { } if (nextItem == null || nextItem.getMedia() == null) { + PlaybackPreferences.writeNoMediaPlaying(); return null; } if (!UserPreferences.isFollowQueue()) { Log.d(TAG, "getNextInQueue(), but follow queue is not enabled."); + PlaybackPreferences.writeMediaPlaying(nextItem.getMedia(), PlayerStatus.STOPPED, false); updateNotificationAndMediaSession(nextItem.getMedia()); return null; } @@ -1042,7 +1046,6 @@ public class PlaybackService extends MediaBrowserServiceCompat { if (stopPlaying) { taskManager.cancelPositionSaver(); cancelPositionObserver(); - PlaybackPreferences.writeNoMediaPlaying(); if (!isCasting) { stateManager.stopForeground(true); stateManager.stopService(); @@ -1291,8 +1294,8 @@ public class PlaybackService extends MediaBrowserServiceCompat { } private void updateNotificationAndMediaSession(final Playable p) { - updateMediaSessionMetadata(p); setupNotification(p); + updateMediaSessionMetadata(p); } private void updateMediaSessionMetadata(final Playable p) { |