aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-04-13 09:09:29 -0700
committerScott Jackson <daneren2005@gmail.com>2014-04-13 09:09:29 -0700
commit0e35e171558c07df14a4fe8c9cd4c00d9ffb6c8c (patch)
treedfeb68a09d2928084e1efc3c8085949b286ea599 /src/github/daneren2005
parent35ad0b7ee6e1125a32afb09bca19535b60544aa3 (diff)
downloaddsub-0e35e171558c07df14a4fe8c9cd4c00d9ffb6c8c.tar.gz
dsub-0e35e171558c07df14a4fe8c9cd4c00d9ffb6c8c.tar.bz2
dsub-0e35e171558c07df14a4fe8c9cd4c00d9ffb6c8c.zip
Fix two cases where downloading doesn't resume after get back network connectivity
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadFile.java7
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java
index b3101e0a..9b7dd45d 100644
--- a/src/github/daneren2005/dsub/service/DownloadFile.java
+++ b/src/github/daneren2005/dsub/service/DownloadFile.java
@@ -227,6 +227,13 @@ public class DownloadFile implements BufferFile {
setPlaying(false);
}
+ @Override
+ public synchronized void onResume() {
+ if(!isFailedMax() && !isDownloading()) {
+ download();
+ }
+ }
+
public synchronized boolean isDownloading() {
return downloadTask != null && downloadTask.isRunning();
}
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index 07b20aad..3637f731 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -1718,6 +1718,8 @@ public class DownloadService extends Service {
Thread.sleep(1000L);
if (isCancelled() || downloadFile.isFailedMax()) {
return null;
+ } else if(!downloadFile.isFailedMax() && !downloadFile.isDownloading()) {
+ checkDownloads();
}
}
doPlay(downloadFile, position, start);