diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-03-19 14:15:59 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-03-19 14:15:59 +0100 |
commit | dfa10a5989ad3b99dbd4f32742aa76de448af92c (patch) | |
tree | 15293c34e8439a28144e4380a8de3a5e759610f2 /src | |
parent | b454ab09740dc8557a670c9c1d4bc8cd19ea129c (diff) | |
download | AntennaPod-dfa10a5989ad3b99dbd4f32742aa76de448af92c.zip |
Playback was not completed correctly. Might fix issue #366 and #374
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(); |