diff options
Diffstat (limited to 'src/de/danoeh/antennapod/asynctask/DownloadStatus.java')
-rw-r--r-- | src/de/danoeh/antennapod/asynctask/DownloadStatus.java | 60 |
1 files changed, 51 insertions, 9 deletions
diff --git a/src/de/danoeh/antennapod/asynctask/DownloadStatus.java b/src/de/danoeh/antennapod/asynctask/DownloadStatus.java index 67cf4a6d8..e5b2bcf5c 100644 --- a/src/de/danoeh/antennapod/asynctask/DownloadStatus.java +++ b/src/de/danoeh/antennapod/asynctask/DownloadStatus.java @@ -14,6 +14,9 @@ public class DownloadStatus { /** Unique id for storing the object in database. */ protected long id; + /** Used by DownloadService to check if the status has been updated. */ + protected volatile boolean updateAvailable; + protected FeedFile feedfile; protected int progressPercent; protected long soFar; @@ -29,8 +32,8 @@ public class DownloadStatus { } /** Constructor for restoring Download status entries from DB. */ - public DownloadStatus(long id, FeedFile feedfile, boolean successful, int reason, - Date completionDate) { + public DownloadStatus(long id, FeedFile feedfile, boolean successful, + int reason, Date completionDate) { this.id = id; this.feedfile = feedfile; progressPercent = 100; @@ -41,11 +44,9 @@ public class DownloadStatus { this.done = true; this.completionDate = completionDate; } - - + /** Constructor for creating new completed downloads. */ - public DownloadStatus(FeedFile feedfile, int reason, - boolean successful) { + public DownloadStatus(FeedFile feedfile, int reason, boolean successful) { this(0, feedfile, successful, reason, new Date()); } @@ -88,8 +89,49 @@ public class DownloadStatus { public boolean isDone() { return done; } - - - + + public void setFeedfile(FeedFile feedfile) { + this.feedfile = feedfile; + } + + public void setProgressPercent(int progressPercent) { + this.progressPercent = progressPercent; + } + + public void setSoFar(long soFar) { + this.soFar = soFar; + } + + public void setSize(long size) { + this.size = size; + } + + public void setStatusMsg(int statusMsg) { + this.statusMsg = statusMsg; + } + + public void setReason(int reason) { + this.reason = reason; + } + + public void setSuccessful(boolean successful) { + this.successful = successful; + } + + public void setDone(boolean done) { + this.done = done; + } + + public void setCompletionDate(Date completionDate) { + this.completionDate = completionDate; + } + + public boolean isUpdateAvailable() { + return updateAvailable; + } + + public void setUpdateAvailable(boolean updateAvailable) { + this.updateAvailable = updateAvailable; + } }
\ No newline at end of file |