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

View File

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