diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-12-30 01:23:47 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-12-30 01:23:47 +0100 |
commit | 162e1d4f9811f64f9f0e952ef850a92aa4614a63 (patch) | |
tree | 8193a9d7291d421cc19980e7ed35ed20a92bb71f | |
parent | b038f3c87778be0d8d503973f986b686e7100dbd (diff) | |
download | AntennaPod-162e1d4f9811f64f9f0e952ef850a92aa4614a63.zip |
Applied bugfix from pull-request #313
-rw-r--r-- | src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java index 04c088d0d..6ab2c758b 100644 --- a/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java +++ b/src/de/danoeh/antennapod/service/playback/PlaybackServiceMediaPlayer.java @@ -4,8 +4,6 @@ import android.content.ComponentName; import android.content.Context; import android.media.AudioManager; import android.media.RemoteControlClient; -import android.os.Handler; -import android.os.Message; import android.util.Log; import android.util.Pair; import android.view.SurfaceHolder; @@ -689,11 +687,11 @@ public class PlaybackServiceMediaPlayer { case AudioManager.AUDIOFOCUS_GAIN: if (AppConfig.DEBUG) Log.d(TAG, "Gained audio focus"); - if (pausedBecauseOfTransientAudiofocusLoss) { + if (pausedBecauseOfTransientAudiofocusLoss) // we paused => play now + resume(); + else // we ducked => raise audio level back audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, 0); - resume(); - } break; case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK: if (playerStatus == PlayerStatus.PLAYING) { @@ -702,7 +700,7 @@ public class PlaybackServiceMediaPlayer { Log.d(TAG, "Lost audio focus temporarily. Ducking..."); audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, 0); - pausedBecauseOfTransientAudiofocusLoss = true; + pausedBecauseOfTransientAudiofocusLoss = false; } else { if (AppConfig.DEBUG) Log.d(TAG, "Lost audio focus temporarily. Could duck, but won't, pausing..."); |