diff --git a/app/src/androidTest/java/org/fdroid/fdroid/net/DownloaderServiceTest.java b/app/src/androidTest/java/org/fdroid/fdroid/net/DownloaderServiceTest.java deleted file mode 100644 index d859d7c0d..000000000 --- a/app/src/androidTest/java/org/fdroid/fdroid/net/DownloaderServiceTest.java +++ /dev/null @@ -1,41 +0,0 @@ - -package org.fdroid.fdroid.net; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.support.v4.content.LocalBroadcastManager; -import android.test.ServiceTestCase; -import android.util.Log; - -@SuppressWarnings("PMD") // TODO port this to JUnit 4 semantics -public class DownloaderServiceTest extends ServiceTestCase { - public static final String TAG = "DownloaderServiceTest"; - - String[] urls = { - "https://en.wikipedia.org/wiki/Index.html", - "https://mirrors.kernel.org/debian/dists/stable/Release", - "https://f-droid.org/archive/de.we.acaldav_5.apk", - // sites that use SNI for HTTPS - "https://guardianproject.info/fdroid/repo/index.jar", - }; - - public DownloaderServiceTest() { - super(DownloaderService.class); - } - - public void testQueueingDownload() throws InterruptedException { - LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(getContext()); - localBroadcastManager.registerReceiver(new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - Log.i(TAG, "onReceive " + intent); - } - }, new IntentFilter(Downloader.ACTION_PROGRESS)); - for (String url : urls) { - DownloaderService.queue(getContext(), null, url); - } - Thread.sleep(30000); - } -} diff --git a/app/src/main/java/org/fdroid/fdroid/net/DownloaderService.java b/app/src/main/java/org/fdroid/fdroid/net/DownloaderService.java index 14b7432e5..0f53a4693 100644 --- a/app/src/main/java/org/fdroid/fdroid/net/DownloaderService.java +++ b/app/src/main/java/org/fdroid/fdroid/net/DownloaderService.java @@ -302,6 +302,10 @@ public class DownloaderService extends Service { downloader = null; } + /** + * Post a notification about a completed download. {@code packageName} must be a valid + * and currently in the app index database. + */ private void notifyDownloadComplete(String packageName, String urlString) { String title; try {