aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
index e5f5d878a..969ea1611 100644
--- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
@@ -280,13 +280,13 @@ public class HttpDownloadConnection implements Transferable {
}
private long retrieveFileSize() throws IOException {
- PowerManager.WakeLock wakeLock = mHttpConnectionManager.createWakeLock("http_download_filesize" + message.getUuid());
try {
- wakeLock.acquire();
Log.d(Config.LOGTAG, "retrieve file size. interactive:" + String.valueOf(interactive));
changeStatus(STATUS_CHECKING);
HttpURLConnection connection;
- if (mUseTor || message.getConversation().getAccount().isOnion()) {
+ final String hostname = mUrl.getHost();
+ final boolean onion = hostname != null && hostname.endsWith(".onion");
+ if (mUseTor || message.getConversation().getAccount().isOnion() || onion) {
connection = (HttpURLConnection) mUrl.openConnection(HttpConnectionManager.getProxy());
} else {
connection = (HttpURLConnection) mUrl.openConnection();
@@ -329,8 +329,6 @@ public class HttpDownloadConnection implements Transferable {
throw e;
} catch (NumberFormatException e) {
throw new IOException();
- } finally {
- WakeLockHelper.release(wakeLock);
}
}