connect instantly in low ping mode after going offline
This commit is contained in:
parent
10398cab51
commit
8c1bb058da
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue