fix: ask for notification permission

This commit is contained in:
J-Jamet
2023-06-18 18:12:17 +02:00
parent 9b4b5914d6
commit 82875ff832
7 changed files with 60 additions and 2 deletions

View File

@@ -281,7 +281,14 @@ class AttachmentFileNotificationService: LockNotificationService() {
AttachmentState.CANCELED,
AttachmentState.ERROR -> {
ServiceCompat.stopForeground(this, ServiceCompat.STOP_FOREGROUND_DETACH)
notificationManager?.notify(attachmentNotification.notificationId, builder.build())
try {
notificationManager?.notify(
attachmentNotification.notificationId,
builder.build()
)
} catch (e: SecurityException) {
Log.e(TAG, "Unable to notify the attachment state", e)
}
} else -> {
startForeground(attachmentNotification.notificationId, builder.build())
}