aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services/XmppConnectionService.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-09-12 17:53:42 +0200
committeriNPUTmice <daniel@gultsch.de>2014-09-12 17:53:42 +0200
commit83c3b33f18429dc8788c2b58a31d150bee553d10 (patch)
treef4451e53a65dd25fd434dcb08bdaad53137e987a /src/eu/siacs/conversations/services/XmppConnectionService.java
parentcee898084ee27592d774c8f62f5be7fd1edf821b (diff)
parent73cba91c9b08ff512104897b32837f9824f1cd3e (diff)
Merge branch 'development'
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-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 f272486c..c019682e 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();
+ }
}
}