mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Merge pull request #2100 from nextcloud/bugfix/2078/RuntimeException-for-cancelExistingNotificationsForRoom
Catch RuntimeException thrown by NotificationManager
This commit is contained in:
commit
10753d039e
@ -1709,14 +1709,19 @@ class ChatController(args: Bundle) :
|
|||||||
binding.messageInputView.findViewById<ImageButton>(R.id.attachmentButton)?.visibility = View.VISIBLE
|
binding.messageInputView.findViewById<ImageButton>(R.id.attachmentButton)?.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
private fun cancelNotificationsForCurrentConversation() {
|
private fun cancelNotificationsForCurrentConversation() {
|
||||||
if (conversationUser != null) {
|
if (conversationUser != null) {
|
||||||
if (!TextUtils.isEmpty(roomToken)) {
|
if (!TextUtils.isEmpty(roomToken)) {
|
||||||
NotificationUtils.cancelExistingNotificationsForRoom(
|
try {
|
||||||
applicationContext,
|
NotificationUtils.cancelExistingNotificationsForRoom(
|
||||||
conversationUser,
|
applicationContext,
|
||||||
roomToken!!
|
conversationUser,
|
||||||
)
|
roomToken!!
|
||||||
|
)
|
||||||
|
} catch (e: RuntimeException) {
|
||||||
|
Log.w(TAG, "Cancel notifications for current conversation results with an error.", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user