diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-01-15 11:46:20 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-01-15 11:46:20 +0100 |
commit | 5c20a67e6687cd700e2c19291d1829254c043e07 (patch) | |
tree | 9ea5abe5916b96882fab637a1b23eab24929ed00 /src/main/java/de/pixart/messenger/http | |
parent | 0ff3c0b3b446fef371d8d768f78e65fc993b3386 (diff) |
only call UI thread from downloading thread every 250ms
Diffstat (limited to 'src/main/java/de/pixart/messenger/http')
-rw-r--r-- | src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java | 8 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/http/HttpUploadConnection.java | 2 |
2 files changed, 5 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 ea0b5c1e8..d49111dbf 100644 --- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java +++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java @@ -126,7 +126,7 @@ public class HttpDownloadConnection implements Transferable { } else { message.setTransferable(null); } - mXmppConnectionService.updateConversationUi(); + mHttpConnectionManager.updateConversationUi(true); } private void finish() { @@ -137,7 +137,7 @@ public class HttpDownloadConnection implements Transferable { if (message.getEncryption() == Message.ENCRYPTION_PGP) { notify = message.getConversation().getAccount().getPgpDecryptionService().decrypt(message, notify); } - mXmppConnectionService.updateConversationUi(); + mHttpConnectionManager.updateConversationUi(true); if (notify) { mXmppConnectionService.getNotificationService().push(message); } @@ -145,7 +145,7 @@ public class HttpDownloadConnection implements Transferable { private void changeStatus(int status) { this.mStatus = status; - mXmppConnectionService.updateConversationUi(); + mHttpConnectionManager.updateConversationUi(true); } private void showToastForException(Exception e) { @@ -350,7 +350,7 @@ public class HttpDownloadConnection implements Transferable { public void updateProgress(int i) { this.mProgress = i; - mXmppConnectionService.updateConversationUi(); + mHttpConnectionManager.updateConversationUi(false); } @Override diff --git a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java index afb0b04df..19d92b353 100644 --- a/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java +++ b/src/main/java/de/pixart/messenger/http/HttpUploadConnection.java @@ -184,7 +184,7 @@ public class HttpUploadConnection implements Transferable { while (((count = mFileInputStream.read(buffer)) != -1) && !canceled) { transmitted += count; os.write(buffer, 0, count); - mXmppConnectionService.updateConversationUi(); + mHttpConnectionManager.updateConversationUi(false); } os.flush(); os.close(); |