diff --git a/app/src/main/java/org/fdroid/fdroid/net/Downloader.java b/app/src/main/java/org/fdroid/fdroid/net/Downloader.java index 45ba5b884..f3ed8e207 100644 --- a/app/src/main/java/org/fdroid/fdroid/net/Downloader.java +++ b/app/src/main/java/org/fdroid/fdroid/net/Downloader.java @@ -1,7 +1,5 @@ package org.fdroid.fdroid.net; -import android.support.annotation.NonNull; - import org.fdroid.fdroid.Utils; import java.io.File; @@ -32,6 +30,11 @@ public abstract class Downloader { protected final URL sourceUrl; protected String cacheTag; + /** + * This is meant only to send progress to {@link DownloaderService}. This + * also keeps this class pure Java so that it can be tested on the JVM, + * without requiring an Android device or emulator. + */ interface DownloaderProgressListener { void sendProgress(URL sourceUrl, int bytesRead, int totalBytes); } @@ -213,12 +216,12 @@ public abstract class Downloader { } @Override - public int read(@NonNull byte[] buffer) throws IOException { + public int read(byte[] buffer) throws IOException { return toWrap.read(buffer); } @Override - public int read(@NonNull byte[] buffer, int byteOffset, int byteCount) throws IOException { + public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException { return toWrap.read(buffer, byteOffset, byteCount); }