diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-09-12 17:53:42 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-09-12 17:53:42 +0200 |
commit | 83c3b33f18429dc8788c2b58a31d150bee553d10 (patch) | |
tree | f4451e53a65dd25fd434dcb08bdaad53137e987a /src/eu/siacs/conversations/services/XmppConnectionService.java | |
parent | cee898084ee27592d774c8f62f5be7fd1edf821b (diff) | |
parent | 73cba91c9b08ff512104897b32837f9824f1cd3e (diff) |
Merge branch 'development'
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 11 |
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(); + } } } |