diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-20 16:33:41 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-20 16:33:41 +0100 |
commit | 80b71f7f462faef91fca628aabe0f6d5c20e0b90 (patch) | |
tree | 5a0d5caf2cc7b427f278581686928634e0b490ab /src/main/java/de/pixart/messenger/services | |
parent | 386927c122e961e776e3af57358c011f1b070451 (diff) |
removed some unecessary locking
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index cf32ad3a9..bde16df00 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -309,7 +309,7 @@ public class XmppConnectionService extends Service { mOnAccountUpdate.onAccountUpdate(); } if (account.getStatus() == Account.State.ONLINE) { - synchronized (XmppConnectionService.this) { + synchronized (mLowPingTimeoutMode) { if (mLowPingTimeoutMode.remove(account.getJid().toBareJid())) { Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": leaving low ping timeout mode"); } @@ -347,10 +347,10 @@ public class XmppConnectionService extends Service { account.pendingConferenceJoins.clear(); scheduleWakeUpCall(Config.PING_MAX_INTERVAL, account.getUuid().hashCode()); } else { - synchronized (XmppConnectionService.this) { - if (account.getStatus() == Account.State.OFFLINE || account.getStatus() == Account.State.DISABLED) { - resetSendingToWaiting(account); - if (!account.isOptionSet(Account.OPTION_DISABLED)) { + if (account.getStatus() == Account.State.OFFLINE || account.getStatus() == Account.State.DISABLED) { + resetSendingToWaiting(account); + if (!account.isOptionSet(Account.OPTION_DISABLED)) { + synchronized (mLowPingTimeoutMode) { 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); @@ -359,20 +359,20 @@ public class XmppConnectionService extends Service { scheduleWakeUpCall(timeToReconnect, account.getUuid().hashCode()); } } - } else if (account.getStatus() == Account.State.REGISTRATION_SUCCESSFUL) { - databaseBackend.updateAccount(account); - reconnectAccount(account, true, false); - } else if ((account.getStatus() != Account.State.CONNECTING) - && (account.getStatus() != Account.State.NO_INTERNET)) { - resetSendingToWaiting(account); - if (connection != null) { - int next = connection.getTimeToNextAttempt(); - Log.d(Config.LOGTAG, account.getJid().toBareJid() - + ": error connecting account. try again in " - + next + "s for the " - + (connection.getAttempt() + 1) + " time"); - scheduleWakeUpCall(next, account.getUuid().hashCode()); - } + } + } else if (account.getStatus() == Account.State.REGISTRATION_SUCCESSFUL) { + databaseBackend.updateAccount(account); + reconnectAccount(account, true, false); + } else if ((account.getStatus() != Account.State.CONNECTING) + && (account.getStatus() != Account.State.NO_INTERNET)) { + resetSendingToWaiting(account); + if (connection != null) { + int next = connection.getTimeToNextAttempt(); + Log.d(Config.LOGTAG, account.getJid().toBareJid() + + ": error connecting account. try again in " + + next + "s for the " + + (connection.getAttempt() + 1) + " time"); + scheduleWakeUpCall(next, account.getUuid().hashCode()); } } } |