diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-02-11 18:57:19 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-02-11 18:57:19 +0100 |
commit | 8e05212c750e9bccee0681efc40d75eebd16fb78 (patch) | |
tree | b9d886c0339a2b5a49c5165222f3acb1c5760682 /src | |
parent | ff285c5ad539acce1baea45c05b064009f70c1e9 (diff) | |
download | AntennaPod-8e05212c750e9bccee0681efc40d75eebd16fb78.zip |
Bugfixes
- Skipping an episode did not work
- pauseOnHeadsetDisconnect preference was not updated correctly
Diffstat (limited to 'src')
3 files changed, 25 insertions, 10 deletions
diff --git a/src/de/danoeh/antennapod/preferences/UserPreferences.java b/src/de/danoeh/antennapod/preferences/UserPreferences.java index f00d6245c..69714c6a8 100644 --- a/src/de/danoeh/antennapod/preferences/UserPreferences.java +++ b/src/de/danoeh/antennapod/preferences/UserPreferences.java @@ -319,7 +319,9 @@ public class UserPreferences implements PREF_PLAYBACK_SPEED_ARRAY, null)); } else if (key.equals(PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS)) { pauseForFocusLoss = sp.getBoolean(PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS, false); - } + } else if (key.equals(PREF_PAUSE_ON_HEADSET_DISCONNECT)) { + pauseOnHeadsetDisconnect = sp.getBoolean(PREF_PAUSE_ON_HEADSET_DISCONNECT, true); + } } public static void setPlaybackSpeed(String speed) { diff --git a/src/de/danoeh/antennapod/service/playback/PlaybackService.java b/src/de/danoeh/antennapod/service/playback/PlaybackService.java index 68034ceb9..21aca915e 100644 --- a/src/de/danoeh/antennapod/service/playback/PlaybackService.java +++ b/src/de/danoeh/antennapod/service/playback/PlaybackService.java @@ -899,7 +899,7 @@ public class PlaybackService extends Service { intent.getAction().equals(ACTION_SKIP_CURRENT_EPISODE)) { if (AppConfig.DEBUG) Log.d(TAG, "Received SKIP_CURRENT_EPISODE intent"); - endPlayback(true); + mediaPlayer.endPlayback(); } } }; diff --git a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java index da273cc0e..52cde2718 100644 --- a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java +++ b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java @@ -737,6 +737,26 @@ public class PlaybackServiceMediaPlayer { } }; + public void endPlayback() { + executor.submit(new Runnable() { + @Override + public void run() { + playerLock.lock(); + + if (playerStatus != PlayerStatus.INDETERMINATE) { + setPlayerStatus(PlayerStatus.INDETERMINATE, media); + } + if (mediaPlayer != null) { + mediaPlayer.reset(); + + } + callback.endPlayback(true); + + playerLock.unlock(); + } + }); + } + /** * Holds information about a PSMP object. */ @@ -808,14 +828,7 @@ public class PlaybackServiceMediaPlayer { }; private void genericOnCompletion() { - executor.submit(new Runnable() { - @Override - public void run() { - audioManager.abandonAudioFocus(audioFocusChangeListener); - callback.endPlayback(true); - } - }); - + endPlayback(); } private final com.aocate.media.MediaPlayer.OnBufferingUpdateListener audioBufferingUpdateListener = new com.aocate.media.MediaPlayer.OnBufferingUpdateListener() { |