diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/de/danoeh/antennapod/service/playback/PlaybackService.java | 15 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/service/playback/PlaybackService.java b/src/de/danoeh/antennapod/service/playback/PlaybackService.java index 6bc8c4127..bb200c5dd 100644 --- a/src/de/danoeh/antennapod/service/playback/PlaybackService.java +++ b/src/de/danoeh/antennapod/service/playback/PlaybackService.java @@ -530,7 +530,7 @@ public class PlaybackService extends Service { stopWidgetUpdater(); } - writePlaybackPreferences(); + writePlaybackPreferencesNoMediaPlaying(); if (nextMedia != null) { stream = !media.localFileAvailable(); mediaPlayer.playMediaObject(nextMedia, stream, startWhenPrepared, prepareImmediately); @@ -555,6 +555,19 @@ public class PlaybackService extends Service { sendNotificationBroadcast(NOTIFICATION_TYPE_SLEEPTIMER_UPDATE, 0); } + private void writePlaybackPreferencesNoMediaPlaying() { + SharedPreferences.Editor editor = PreferenceManager + .getDefaultSharedPreferences(getApplicationContext()).edit(); + editor.putLong(PlaybackPreferences.PREF_CURRENTLY_PLAYING_MEDIA, + PlaybackPreferences.NO_MEDIA_PLAYING); + editor.putLong(PlaybackPreferences.PREF_CURRENTLY_PLAYING_FEED_ID, + PlaybackPreferences.NO_MEDIA_PLAYING); + editor.putLong( + PlaybackPreferences.PREF_CURRENTLY_PLAYING_FEEDMEDIA_ID, + PlaybackPreferences.NO_MEDIA_PLAYING); + editor.commit(); + } + private void writePlaybackPreferences() { if (AppConfig.DEBUG) diff --git a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java index 30f6de458..9e4624794 100644 --- a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java +++ b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java @@ -756,6 +756,7 @@ public class PlaybackServiceMediaPlayer { mediaPlayer.reset(); } + audioManager.abandonAudioFocus(audioFocusChangeListener); callback.endPlayback(true); playerLock.unlock(); |