aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-09-10 17:59:57 +0200
committeriNPUTmice <daniel@gultsch.de>2014-09-10 17:59:57 +0200
commit31f11070e37636e9c47d74ad080c4786b14ff1b7 (patch)
treea784db787be53b14138f184aed6066a189575087 /src/eu/siacs/conversations/services
parenta6d4a9cda1684d9a316146de4c6797834f7b0121 (diff)
IT'S CHRISTMAS ALREADY!
Diffstat (limited to 'src/eu/siacs/conversations/services')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index f272486cc..c019682e3 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -109,6 +109,7 @@ public class XmppConnectionService extends Service {
private OnAccountUpdate mOnAccountUpdate = null;
private int accountChangedListenerCount = 0;
private OnRosterUpdate mOnRosterUpdate = null;
+ private int rosterChangedListenerCount = 0;
public OnContactStatusChanged onContactStatusChanged = new OnContactStatusChanged() {
@Override
@@ -997,12 +998,16 @@ public class XmppConnectionService extends Service {
switchToForeground();
}
this.mOnRosterUpdate = listener;
+ this.rosterChangedListenerCount++;
}
public void removeOnRosterUpdateListener() {
- this.mOnRosterUpdate = null;
- if (checkListeners()) {
- switchToBackground();
+ this.rosterChangedListenerCount--;
+ if (this.rosterChangedListenerCount == 0) {
+ this.mOnRosterUpdate = null;
+ if (checkListeners()) {
+ switchToBackground();
+ }
}
}