From 15e5ccd1f44a496f9cbd8a5df818d57f6f6794f2 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 30 Apr 2017 13:59:45 +0200 Subject: [PATCH] avoid race condition that lead to double notification sound --- .../eu/siacs/conversations/services/NotificationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index c7d80b54..29da2d4c 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -233,6 +233,7 @@ public class NotificationService { } public void updateNotification(final boolean notify) { + Log.d(Config.LOGTAG,"updateNotification("+Boolean.toString(notify)+")"); final NotificationManagerCompat notificationManager = NotificationManagerCompat.from(mXmppConnectionService); final SharedPreferences preferences = mXmppConnectionService.getPreferences(); @@ -250,13 +251,13 @@ public class NotificationService { } else { mBuilder = buildMultipleConversation(); modifyForSoundVibrationAndLight(mBuilder, notify, preferences); - notificationManager.notify(NOTIFICATION_ID, mBuilder.build()); for(Map.Entry> entry : notifications.entrySet()) { Builder singleBuilder = buildSingleConversations(entry.getValue()); singleBuilder.setGroup(CONVERSATIONS_GROUP); modifyForSoundVibrationAndLight(singleBuilder,notify,preferences); notificationManager.notify(entry.getKey(), NOTIFICATION_ID ,singleBuilder.build()); } + notificationManager.notify(NOTIFICATION_ID, mBuilder.build()); } } }