Make it possible to dismiss failure notification

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
This commit is contained in:
Dariusz Olszewski 2022-10-27 23:47:13 +02:00 committed by Marcel Hibbe
parent b641121266
commit bfc9f57b2a
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -258,9 +258,13 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
notification = mBuilder!! notification = mBuilder!!
.setContentTitle(failureTitle) .setContentTitle(failureTitle)
.setContentText(failureText) .setContentText(failureText)
.setOngoing(false)
.build() .build()
mNotifyManager!!.notify(notificationId, notification) // Cancel original notification
mNotifyManager?.cancel(notificationId)
// Then show information about failure
mNotifyManager!!.notify(SystemClock.uptimeMillis().toInt(), notification)
} }
companion object { companion object {