From 311dc13aa0d3c36e536a7e38fb646ad8406e94e1 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 25 Sep 2014 15:13:22 -0700 Subject: Add logs for loss of focus to help with debugging --- src/github/daneren2005/dsub/util/Util.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/github') diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java index c80c0824..0b3f03b3 100644 --- a/src/github/daneren2005/dsub/util/Util.java +++ b/src/github/daneren2005/dsub/util/Util.java @@ -1141,7 +1141,8 @@ public final class Util { public void onAudioFocusChange(int focusChange) { DownloadService downloadService = (DownloadService)context; if((focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT || focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) && !downloadService.isRemoteEnabled()) { - if(downloadService.getPlayerState() == PlayerState.STARTED) { + if(downloadService.getPlayerState() == PlayerState.STARTED) { + Log.i(TAG, "Temporary loss of focus"); SharedPreferences prefs = getPreferences(context); int lossPref = Integer.parseInt(prefs.getString(Constants.PREFERENCES_KEY_TEMP_LOSS, "1")); if(lossPref == 2 || (lossPref == 1 && focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK)) { @@ -1161,6 +1162,7 @@ public final class Util { downloadService.setVolume(1.0f); } } else if(focusChange == AudioManager.AUDIOFOCUS_LOSS && !downloadService.isRemoteEnabled()) { + Log.i(TAG, "Permanently lost focus"); focusListener = null; downloadService.pause(); audioManager.abandonAudioFocus(this); -- cgit v1.2.3