From 2bdd4ba3db808d6b283d11d77dfd503e94ed4b1e Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 22 Feb 2014 11:18:13 -0800 Subject: Cancel buffer tasks when going to remote --- src/github/daneren2005/dsub/service/DownloadService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index b3a989ed..396bfdee 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1154,6 +1154,16 @@ public class DownloadService extends Service { if (currentDownloading != null) { currentDownloading.cancelDownload(); } + + // Cancels current setup tasks + if(bufferTask != null && bufferTask.isRunning()) { + bufferTask.cancel(); + bufferTask = null; + } + if(nextPlayingTask != null && nextPlayingTask.isRunning()) { + nextPlayingTask.cancel(); + nextPlayingTask = null; + } } SharedPreferences prefs = Util.getPreferences(this); -- cgit v1.2.3