aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-06-01 21:52:33 +0200
committerChristian Schneppe <christian@pix-art.de>2018-06-01 21:52:33 +0200
commit0a9e68e77ea53fa051e4050e1a63ea15930f4943 (patch)
tree48544d7143041c306184cd1ee0e051fe7a439982 /src
parent51439dc2e59a5d8ff3ef8b68b32c5617f7ebec27 (diff)
add more logging to setIsInForeground
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java1
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java3
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationsActivity.java1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index ede62630c..03e51bef8 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -199,7 +199,6 @@ public class NotificationService {
final boolean isScreenOn = mXmppConnectionService.isInteractive();
if (this.mIsInForeground && isScreenOn && this.mOpenConversation == message.getConversation()) {
Log.d(Config.LOGTAG, message.getConversation().getAccount().getJid().asBareJid() + ": suppressing notification because conversation is open");
- mXmppConnectionService.vibrate();
return;
}
if (this.mIsInForeground && isScreenOn) {
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 988f247f0..cf3dd7462 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -2124,6 +2124,7 @@ public class XmppConnectionService extends Service {
switchToForeground();
}
this.mOnConversationUpdates.add(listener);
+ Log.d(Config.LOGTAG, "XmppConnectionService setOnConversationListChangedListener(): setIsInForeground = " + (this.mOnConversationUpdates.size() > 0));
this.mNotificationService.setIsInForeground(this.mOnConversationUpdates.size() > 0);
}
}
@@ -2131,6 +2132,7 @@ public class XmppConnectionService extends Service {
public void removeOnConversationListChangedListener(OnConversationUpdate listener) {
synchronized (this) {
this.mOnConversationUpdates.remove(listener);
+ Log.d(Config.LOGTAG, "XmppConnectionService removeOnConversationListChangedListener(): setIsInForeground = " + (this.mOnConversationUpdates.size() > 0));
this.mNotificationService.setIsInForeground(this.mOnConversationUpdates.size() > 0);
if (checkListeners()) {
switchToBackground();
@@ -2321,6 +2323,7 @@ public class XmppConnectionService extends Service {
}
}
}
+ Log.d(Config.LOGTAG, "XmppConnectionService switchToBackground(): setIsInForeground = false");
this.mNotificationService.setIsInForeground(false);
Log.d(Config.LOGTAG, "app switched into background");
}
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java
index 686d435bb..590b93d6c 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java
@@ -145,6 +145,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
if (performRedirectIfNecessary(true)) {
return;
}
+ Log.d(Config.LOGTAG, "ConversationsActivity onBackendConnected(): setIsInForeground = true");
xmppConnectionService.getNotificationService().setIsInForeground(true);
final Intent FirstStartIntent = getIntent();