don’t let attempt count fall below zero

This commit is contained in:
Daniel Gultsch 2016-05-10 17:48:09 +02:00
parent c37b5af2ca
commit 8e3948e495

View file

@ -355,7 +355,7 @@ public class XmppConnection implements Runnable {
} catch (final IOException | XmlPullParserException | NoSuchAlgorithmException e) { } catch (final IOException | XmlPullParserException | NoSuchAlgorithmException e) {
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": " + e.getMessage()); Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": " + e.getMessage());
this.changeStatus(Account.State.OFFLINE); this.changeStatus(Account.State.OFFLINE);
this.attempt--; //don't count attempt when reconnecting instantly anyway this.attempt = Math.max(0, this.attempt - 1);
} finally { } finally {
forceCloseSocket(); forceCloseSocket();
if (wakeLock.isHeld()) { if (wakeLock.isHeld()) {