aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-01-31 19:06:22 -0800
committerScott Jackson <daneren2005@gmail.com>2013-01-31 19:06:22 -0800
commitd200272df9a7753dbba058476349d49816fa0303 (patch)
treea8bef1d1b6c98ab0d90c5529076d4aac2a9c37db /subsonic-android/src/github/daneren2005
parent43f25636b8954d078eefe1ed34ebb77f655f6712 (diff)
downloaddsub-d200272df9a7753dbba058476349d49816fa0303.tar.gz
dsub-d200272df9a7753dbba058476349d49816fa0303.tar.bz2
dsub-d200272df9a7753dbba058476349d49816fa0303.zip
Closes #103 Don't pause when in jukebox mode
Diffstat (limited to 'subsonic-android/src/github/daneren2005')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java2
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/util/Util.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
index 130a00f6..6ff45dee 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java
@@ -253,7 +253,7 @@ public class DownloadServiceLifecycleSupport {
switch (state) {
case TelephonyManager.CALL_STATE_RINGING:
case TelephonyManager.CALL_STATE_OFFHOOK:
- if (downloadService.getPlayerState() == PlayerState.STARTED) {
+ if (downloadService.getPlayerState() == PlayerState.STARTED && !downloadService.isJukeboxEnabled()) {
resumeAfterCall = true;
downloadService.pause();
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/Util.java b/subsonic-android/src/github/daneren2005/dsub/util/Util.java
index 83a9c988..bbbb0573 100644
--- a/subsonic-android/src/github/daneren2005/dsub/util/Util.java
+++ b/subsonic-android/src/github/daneren2005/dsub/util/Util.java
@@ -826,7 +826,7 @@ public final class Util {
audioManager.requestAudioFocus(new OnAudioFocusChangeListener() {
public void onAudioFocusChange(int focusChange) {
DownloadServiceImpl downloadService = (DownloadServiceImpl)context;
- if(focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT || focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) {
+ if((focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT || focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) && !downloadService.isJukeboxEnabled()) {
if(downloadService.getPlayerState() == PlayerState.STARTED) {
SharedPreferences prefs = getPreferences(context);
int lossPref = Integer.parseInt(prefs.getString(Constants.PREFERENCES_KEY_TEMP_LOSS, "1"));
@@ -846,7 +846,7 @@ public final class Util {
lowerFocus = false;
downloadService.setVolume(1.0f);
}
- } else if(focusChange == AudioManager.AUDIOFOCUS_LOSS) {
+ } else if(focusChange == AudioManager.AUDIOFOCUS_LOSS && !downloadService.isJukeboxEnabled()) {
hasFocus = false;
downloadService.pause();
audioManager.abandonAudioFocus(this);