do not synchronize startXmpp() and sendPacket() on the same object as this can block the ui

This commit is contained in:
Daniel Gultsch 2017-05-06 15:37:22 +02:00
parent be371ac5df
commit 9a7d925b97
1 changed files with 2 additions and 4 deletions

View File

@ -441,7 +441,7 @@ public class XmppConnection implements Runnable {
* Starts xmpp protocol, call after connecting to socket
* @return true if server returns with valid xmpp, false otherwise
*/
private synchronized boolean startXmpp(Socket socket) throws Exception {
private boolean startXmpp(Socket socket) throws Exception {
if (Thread.currentThread().isInterrupted()) {
throw new InterruptedException();
}
@ -643,9 +643,7 @@ public class XmppConnection implements Runnable {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": resumption failed");
}
resetStreamId();
if (account.getStatus() != Account.State.ONLINE) {
sendBindRequest();
}
} else if (nextTag.isStart("iq")) {
processIq(nextTag);
} else if (nextTag.isStart("message")) {