diff options
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 3f643593..aa575145 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1344,6 +1344,11 @@ public class DownloadService extends Service { setRemoteState(newState, ref, null); } private void setRemoteState(final RemoteControlState newState, final Object ref, final String routeId) { + // Don't try to do anything if already in the correct state + if(remoteState == newState) { + return; + } + boolean isPlaying = playerState == STARTED; int position = getPlayerPosition(); @@ -1358,6 +1363,7 @@ public class DownloadService extends Service { } } + Log.i(TAG, remoteState.name() + " => " + newState.name() + " (" + currentPlaying + ")"); remoteState = newState; switch(newState) { case JUKEBOX_SERVER: @@ -1484,6 +1490,7 @@ public class DownloadService extends Service { subtractPosition = 0; mediaPlayer.setOnCompletionListener(null); + mediaPlayer.setOnPreparedListener(null); mediaPlayer.reset(); setPlayerState(IDLE); try { |