aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-14 17:14:07 +0200
committeriNPUTmice <daniel@gultsch.de>2014-10-14 17:14:07 +0200
commit470410b389bc38ab22fe5f877149c93795c5b0fb (patch)
tree12b76b52a2b0649be77560081390561c657349d2 /src
parentc18e986a93d7a36769b6fdecdcea154c7b3d2024 (diff)
possible work around for notification bug
Diffstat (limited to 'src')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index 3549ce0a..0dda4b31 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -975,6 +975,10 @@ public class XmppConnectionService extends Service {
public void setOnConversationListChangedListener(
OnConversationUpdate listener) {
+ if (!isScreenOn()) {
+ Log.d(Config.LOGTAG,"ignoring setOnConversationListChangedListener");
+ return;
+ }
this.mNotificationService.deactivateGracePeriod();
if (checkListeners()) {
switchToForeground();
@@ -996,6 +1000,10 @@ public class XmppConnectionService extends Service {
}
public void setOnAccountListChangedListener(OnAccountUpdate listener) {
+ if (!isScreenOn()) {
+ Log.d(Config.LOGTAG,"ignoring setOnAccountListChangedListener");
+ return;
+ }
this.mNotificationService.deactivateGracePeriod();
if (checkListeners()) {
switchToForeground();
@@ -1015,6 +1023,10 @@ public class XmppConnectionService extends Service {
}
public void setOnRosterUpdateListener(OnRosterUpdate listener) {
+ if (!isScreenOn()) {
+ Log.d(Config.LOGTAG,"ignoring setOnRosterUpdateListener");
+ return;
+ }
this.mNotificationService.deactivateGracePeriod();
if (checkListeners()) {
switchToForeground();
@@ -1063,6 +1075,11 @@ public class XmppConnectionService extends Service {
}
}
}
+
+ private boolean isScreenOn() {
+ PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
+ return pm.isScreenOn();
+ }
public void connectMultiModeConversations(Account account) {
List<Conversation> conversations = getConversations();