From 7e7bc13b6208680971a3ddf211d9b4e56ee0e3f5 Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Wed, 25 May 2022 10:50:06 -0400 Subject: [PATCH] Swallow too many pending intents exception. --- .../notifications/v2/NotificationFactory.kt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationFactory.kt b/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationFactory.kt index d4b961da5..5db95f563 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationFactory.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/NotificationFactory.kt @@ -148,13 +148,17 @@ object NotificationFactory { threadsThatNewlyAlerted += conversation.thread } - notifyForConversation( - context = context, - conversation = conversation, - targetThread = targetThread, - defaultBubbleState = defaultBubbleState, - shouldAlert = (conversation.hasNewNotifications() || alertOverrides.contains(conversation.thread)) && !conversation.mostRecentNotification.individualRecipient.isSelf - ) + try { + notifyForConversation( + context = context, + conversation = conversation, + targetThread = targetThread, + defaultBubbleState = defaultBubbleState, + shouldAlert = (conversation.hasNewNotifications() || alertOverrides.contains(conversation.thread)) && !conversation.mostRecentNotification.individualRecipient.isSelf + ) + } catch (e: SecurityException) { + Log.w(TAG, "Too many pending intents device quirk", e) + } } }