From 4391e7f6e53226e8434050e9306e655684c761b9 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 4 Mar 2015 17:30:51 -0800 Subject: Fix double clicking pausing on headsets pausing after going to next song --- src/github/daneren2005/dsub/service/DownloadService.java | 5 ++++- .../daneren2005/dsub/service/DownloadServiceLifecycleSupport.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 24c710dd..562d621c 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -981,6 +981,9 @@ public class DownloadService extends Service { next(false); } public synchronized void next(boolean forceCutoff) { + next(forceCutoff, false); + } + public synchronized void next(boolean forceCutoff, boolean forceStart) { // If only one song, just skip within song if(size() == 1) { seekTo(getPlayerPosition() + FAST_FORWARD); @@ -1015,7 +1018,7 @@ public class DownloadService extends Service { nextPlayingIndex++; } if (index != -1 && nextPlayingIndex < size()) { - play(nextPlayingIndex, playerState != PAUSED && playerState != STOPPED && playerState != IDLE); + play(nextPlayingIndex, playerState != PAUSED && playerState != STOPPED && playerState != IDLE || forceStart); } } diff --git a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java index fa0e66af..278c7e4f 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java @@ -334,7 +334,7 @@ public class DownloadServiceLifecycleSupport { lastPressTime = System.currentTimeMillis(); downloadService.togglePlayPause(); } else { - downloadService.next(); + downloadService.next(false, true); } break; case RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS: -- cgit v1.2.3