diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-02-22 11:18:13 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-02-22 11:18:13 -0800 |
commit | 2bdd4ba3db808d6b283d11d77dfd503e94ed4b1e (patch) | |
tree | 28058bfa975a32f6bf167539ff3d12e28dc7256e /src | |
parent | 6813b02d18e528a1730fad9cdf0b3f5ff1b32ffe (diff) | |
download | dsub-2bdd4ba3db808d6b283d11d77dfd503e94ed4b1e.tar.gz dsub-2bdd4ba3db808d6b283d11d77dfd503e94ed4b1e.tar.bz2 dsub-2bdd4ba3db808d6b283d11d77dfd503e94ed4b1e.zip |
Cancel buffer tasks when going to remote
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 10 |
1 files changed, 10 insertions, 0 deletions
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); |