From cd0b5b80f938c6646266518f2a16c3f93545e5c7 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 19 Jun 2015 16:24:42 -0400 Subject: [PATCH] purge unused methods from ApkDownloader and AsyncDownloadWrapper --- .../org/fdroid/fdroid/net/ApkDownloader.java | 12 -------- .../fdroid/net/AsyncDownloadWrapper.java | 28 ------------------- 2 files changed, 40 deletions(-) diff --git a/F-Droid/src/org/fdroid/fdroid/net/ApkDownloader.java b/F-Droid/src/org/fdroid/fdroid/net/ApkDownloader.java index 630a913c7..d71abd5df 100644 --- a/F-Droid/src/org/fdroid/fdroid/net/ApkDownloader.java +++ b/F-Droid/src/org/fdroid/fdroid/net/ApkDownloader.java @@ -232,18 +232,6 @@ public class ApkDownloader implements AsyncDownloadWrapper.Listener { } } - @Override - public void onReceiveTotalDownloadSize(int size) { - // Do nothing... - // Rather, we will obtain the total download size from the progress events - // when they start coming through. - } - - @Override - public void onReceiveCacheTag(String cacheTag) { - // Do nothing... - } - @Override public void onErrorDownloading(String localisedExceptionDetails) { Log.e(TAG, "Download failed: " + localisedExceptionDetails); diff --git a/F-Droid/src/org/fdroid/fdroid/net/AsyncDownloadWrapper.java b/F-Droid/src/org/fdroid/fdroid/net/AsyncDownloadWrapper.java index d113f93f3..8abf8b4ed 100644 --- a/F-Droid/src/org/fdroid/fdroid/net/AsyncDownloadWrapper.java +++ b/F-Droid/src/org/fdroid/fdroid/net/AsyncDownloadWrapper.java @@ -43,16 +43,6 @@ public class AsyncDownloadWrapper extends Handler { this.listener = listener; } - public void fetchTotalDownloadSize() { - int size = downloader.totalDownloadSize(); - listener.onReceiveTotalDownloadSize(size); - } - - public void fetchCacheTag() { - String cacheTag = downloader.getCacheTag(); - listener.onReceiveCacheTag(cacheTag); - } - public void download() { downloadThread = new DownloadThread(); downloadThread.start(); @@ -64,22 +54,6 @@ public class AsyncDownloadWrapper extends Handler { } } - public static class NotDownloadingException extends Exception { - public NotDownloadingException(String message) { - super(message); - } - } - - public void cancelDownload() throws NotDownloadingException { - if (downloadThread == null) { - throw new RuntimeException("Can't cancel download, it hasn't started yet."); - } else if (!downloadThread.isAlive()) { - throw new RuntimeException("Can't cancel download, it is already finished."); - } - - downloadThread.interrupt(); - } - /** * Receives "messages" from the download thread, and passes them onto the * relevant {@link org.fdroid.fdroid.net.AsyncDownloadWrapper.Listener} @@ -105,8 +79,6 @@ public class AsyncDownloadWrapper extends Handler { } public interface Listener extends ProgressListener { - void onReceiveTotalDownloadSize(int size); - void onReceiveCacheTag(String cacheTag); void onErrorDownloading(String localisedExceptionDetails); void onDownloadComplete(); void onDownloadCancelled();