From 3b79cc2f23617903dda1876f80fd295d45e9ba3b Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Tue, 19 Aug 2014 15:06:50 +0200 Subject: better error display and additional infos (stats) for the edit account activity --- .../siacs/conversations/services/XmppConnectionService.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/eu/siacs/conversations/services') diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 2c27315e2..593b1fd09 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -183,7 +183,7 @@ public class XmppConnectionService extends Service { + "s for the " + (account.getXmppConnection().getAttempt() + 1) + " time"); - scheduleWakeupCall(next, false); + scheduleWakeupCall((int) (next * 1.2), false); } UIHelper.showErrorNotification(getApplicationContext(), getAccounts()); @@ -317,15 +317,13 @@ public class XmppConnectionService extends Service { } } if (account.getStatus() == Account.STATUS_ONLINE) { - long lastReceived = account.getXmppConnection().lastPaketReceived; - long lastSent = account.getXmppConnection().lastPingSent; + long lastReceived = account.getXmppConnection().getLastPacketReceived(); + long lastSent = account.getXmppConnection().getLastPingSent(); if (lastSent - lastReceived >= PING_TIMEOUT * 1000) { Log.d(LOGTAG, account.getJid() + ": ping timeout"); this.reconnectAccount(account, true); } else if (SystemClock.elapsedRealtime() - lastReceived >= PING_MIN_INTERVAL * 1000) { account.getXmppConnection().sendPing(); - account.getXmppConnection().lastPingSent = SystemClock - .elapsedRealtime(); this.scheduleWakeupCall(2, false); } } else if (account.getStatus() == Account.STATUS_OFFLINE) { @@ -333,12 +331,10 @@ public class XmppConnectionService extends Service { account.setXmppConnection(this .createConnection(account)); } - account.getXmppConnection().lastPingSent = SystemClock - .elapsedRealtime(); new Thread(account.getXmppConnection()).start(); } else if ((account.getStatus() == Account.STATUS_CONNECTING) && ((SystemClock.elapsedRealtime() - account - .getXmppConnection().lastConnect) / 1000 >= CONNECT_TIMEOUT)) { + .getXmppConnection().getLastConnect()) / 1000 >= CONNECT_TIMEOUT)) { Log.d(LOGTAG, account.getJid() + ": time out during connect reconnecting"); reconnectAccount(account, true); -- cgit v1.2.3