connect instantly in low ping mode after going offline

This commit is contained in:
Daniel Gultsch 2016-10-23 09:03:17 +02:00
parent 10398cab51
commit 8c1bb058da
1 changed files with 7 additions and 2 deletions

View File

@ -336,9 +336,14 @@ public class XmppConnectionService extends Service {
&& listeners; && listeners;
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": push mode="+Boolean.toString(pushMode)+" listeners="+Boolean.toString(listeners)); Log.d(Config.LOGTAG,account.getJid().toBareJid()+": push mode="+Boolean.toString(pushMode)+" listeners="+Boolean.toString(listeners));
if (!disabled && !pushMode) { if (!disabled && !pushMode) {
if (mLowPingTimeoutMode.contains(account.getJid().toBareJid())) {
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": went into offline state during low ping mode. reconnecting now");
reconnectAccount(account,true,false);
} else {
int timeToReconnect = mRandom.nextInt(20) + 10; int timeToReconnect = mRandom.nextInt(20) + 10;
scheduleWakeUpCall(timeToReconnect, account.getUuid().hashCode()); scheduleWakeUpCall(timeToReconnect, account.getUuid().hashCode());
} }
}
} else if (account.getStatus() == Account.State.REGISTRATION_SUCCESSFUL) { } else if (account.getStatus() == Account.State.REGISTRATION_SUCCESSFUL) {
databaseBackend.updateAccount(account); databaseBackend.updateAccount(account);
reconnectAccount(account, true, false); reconnectAccount(account, true, false);