summaryrefslogtreecommitdiff
path: root/src/de/podfetcher/storage
diff options
context:
space:
mode:
authorDaniel Oeh <daniel@daniel-pc.(none)>2011-12-24 21:10:23 +0100
committerDaniel Oeh <daniel@daniel-pc.(none)>2011-12-24 21:10:23 +0100
commit48144440cf09f486177589410219be4b1184dd24 (patch)
tree6d5e79da65e37ccfdbec15dbddb70dff0f72935c /src/de/podfetcher/storage
parent53daf91337a70859edae9c3cfb9ec2a8ea3d6229 (diff)
downloadAntennaPod-48144440cf09f486177589410219be4b1184dd24.zip
Implemented FeedSyncService Termination Process
Diffstat (limited to 'src/de/podfetcher/storage')
-rw-r--r--src/de/podfetcher/storage/DownloadService.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/de/podfetcher/storage/DownloadService.java b/src/de/podfetcher/storage/DownloadService.java
index 74a346623..d6bb19967 100644
--- a/src/de/podfetcher/storage/DownloadService.java
+++ b/src/de/podfetcher/storage/DownloadService.java
@@ -16,6 +16,8 @@ import android.content.BroadcastReceiver;
import android.content.Context;
public class DownloadService extends Service {
+
+ public static String ACTION_ALL_FEED_DOWNLOADS_COMPLETED = "action.de.podfetcher.storage.all_feed_downloads_completed";
private DownloadRequester requester;
private FeedManager manager;
@@ -53,6 +55,11 @@ public class DownloadService extends Service {
String action = item_intent.getAction();
if(action.equals(DownloadRequester.ACTION_FEED_DOWNLOAD_COMPLETED)) {
handleCompletedFeedDownload(context, intent);
+ // Notify FeedSyncService about the new Feed
+ sendBroadcast(item_intent);
+ if(requester.getNumberOfFeedDownloads() == 0) {
+ sendBroadcast(new Intent(ACTION_ALL_FEED_DOWNLOADS_COMPLETED));
+ }
} else if(action.equals(DownloadRequester.ACTION_MEDIA_DOWNLOAD_COMPLETED)) {
requester.removeMediaByID(item_intent.getLongExtra(DownloadRequester.EXTRA_ITEM_ID, -1));
} else if(action.equals(DownloadRequester.ACTION_IMAGE_DOWNLOAD_COMPLETED)) {
@@ -63,7 +70,6 @@ public class DownloadService extends Service {
if(requester.getNumberOfDownloads() == 0) {
stopSelf();
}
- //PodcastApp.getInstance().getApplicationContext().sendBroadcast(item_intent);
}
};