purge unused methods from ApkDownloader and AsyncDownloadWrapper
This commit is contained in:
parent
5d4bdf6139
commit
cd0b5b80f9
@ -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
|
@Override
|
||||||
public void onErrorDownloading(String localisedExceptionDetails) {
|
public void onErrorDownloading(String localisedExceptionDetails) {
|
||||||
Log.e(TAG, "Download failed: " + localisedExceptionDetails);
|
Log.e(TAG, "Download failed: " + localisedExceptionDetails);
|
||||||
|
@ -43,16 +43,6 @@ public class AsyncDownloadWrapper extends Handler {
|
|||||||
this.listener = listener;
|
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() {
|
public void download() {
|
||||||
downloadThread = new DownloadThread();
|
downloadThread = new DownloadThread();
|
||||||
downloadThread.start();
|
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
|
* Receives "messages" from the download thread, and passes them onto the
|
||||||
* relevant {@link org.fdroid.fdroid.net.AsyncDownloadWrapper.Listener}
|
* relevant {@link org.fdroid.fdroid.net.AsyncDownloadWrapper.Listener}
|
||||||
@ -105,8 +79,6 @@ public class AsyncDownloadWrapper extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface Listener extends ProgressListener {
|
public interface Listener extends ProgressListener {
|
||||||
void onReceiveTotalDownloadSize(int size);
|
|
||||||
void onReceiveCacheTag(String cacheTag);
|
|
||||||
void onErrorDownloading(String localisedExceptionDetails);
|
void onErrorDownloading(String localisedExceptionDetails);
|
||||||
void onDownloadComplete();
|
void onDownloadComplete();
|
||||||
void onDownloadCancelled();
|
void onDownloadCancelled();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user