@@ -17,6 +17,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult
1717import com.owncloud.android.operations.UploadFileOperation
1818import com.owncloud.android.ui.notifications.NotificationUtils
1919import com.owncloud.android.utils.theme.ViewThemeUtils
20+ import kotlin.random.Random
2021
2122class UploadNotificationManager (private val context : Context , viewThemeUtils : ViewThemeUtils , id : Int ) :
2223 WorkerNotificationManager (id, context, viewThemeUtils, R .string.foreground_service_upload) {
@@ -77,7 +78,8 @@ class UploadNotificationManager(private val context: Context, viewThemeUtils: Vi
7778 conflictsResolveIntent : PendingIntent ? ,
7879 cancelUploadActionIntent : PendingIntent ? ,
7980 credentialIntent : PendingIntent ? ,
80- errorMessage : String
81+ errorMessage : String ,
82+ showNewNotification : Boolean = false
8183 ) {
8284 if (uploadFileOperation.isMissingPermissionThrown) {
8385 return
@@ -116,7 +118,7 @@ class UploadNotificationManager(private val context: Context, viewThemeUtils: Vi
116118 setContentText(errorMessage)
117119 }
118120
119- if (resultCode.isFileSpecificError()) {
121+ if (resultCode.isFileSpecificError() || showNewNotification ) {
120122 showNewNotification(uploadFileOperation)
121123 } else {
122124 showNotification()
@@ -146,7 +148,7 @@ class UploadNotificationManager(private val context: Context, viewThemeUtils: Vi
146148 private fun showNewNotification (operation : UploadFileOperation ) {
147149 notificationManager.notify(
148150 NotificationUtils .createUploadNotificationTag(operation.file),
149- FileUploadWorker . NOTIFICATION_ERROR_ID ,
151+ Random . Default .nextInt() ,
150152 notificationBuilder.build()
151153 )
152154 }
0 commit comments