diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-09-25 15:13:22 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-09-25 15:13:22 -0700 |
commit | 311dc13aa0d3c36e536a7e38fb646ad8406e94e1 (patch) | |
tree | 1cf79cab6f97c7338a5e5b88e7e7a741d1d3977d | |
parent | fe4cdf93e7836b7964fcf95a3da02f78eac6212b (diff) | |
download | dsub-311dc13aa0d3c36e536a7e38fb646ad8406e94e1.tar.gz dsub-311dc13aa0d3c36e536a7e38fb646ad8406e94e1.tar.bz2 dsub-311dc13aa0d3c36e536a7e38fb646ad8406e94e1.zip |
Add logs for loss of focus to help with debugging
-rw-r--r-- | src/github/daneren2005/dsub/util/Util.java | 4 |
1 files changed, 3 insertions, 1 deletions
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); |