log reason for not showing notification

This commit is contained in:
Daniel Gultsch 2016-06-19 11:04:59 +02:00
parent 85c82d9b3b
commit 37e7175a86
1 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import android.support.v4.app.NotificationCompat.Builder;
import android.support.v4.app.TaskStackBuilder; import android.support.v4.app.TaskStackBuilder;
import android.text.Html; import android.text.Html;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
@ -136,10 +137,12 @@ public class NotificationService {
public void push(final Message message) { public void push(final Message message) {
mXmppConnectionService.updateUnreadCountBadge(); mXmppConnectionService.updateUnreadCountBadge();
if (!notify(message)) { if (!notify(message)) {
Log.d(Config.LOGTAG,message.getConversation().getAccount().getJid().toBareJid()+": suppressing notification because turned off");
return; return;
} }
final boolean isScreenOn = mXmppConnectionService.isInteractive(); final boolean isScreenOn = mXmppConnectionService.isInteractive();
if (this.mIsInForeground && isScreenOn && this.mOpenConversation == message.getConversation()) { if (this.mIsInForeground && isScreenOn && this.mOpenConversation == message.getConversation()) {
Log.d(Config.LOGTAG,message.getConversation().getAccount().getJid().toBareJid()+": suppressing notification because conversation is open");
return; return;
} }
synchronized (notifications) { synchronized (notifications) {