diff --git a/app/src/main/java/com/nextcloud/client/files/downloader/DownloadNotificationManager.kt b/app/src/main/java/com/nextcloud/client/files/downloader/DownloadNotificationManager.kt index d0f381c418c5..451aaf2235eb 100644 --- a/app/src/main/java/com/nextcloud/client/files/downloader/DownloadNotificationManager.kt +++ b/app/src/main/java/com/nextcloud/client/files/downloader/DownloadNotificationManager.kt @@ -120,7 +120,7 @@ class DownloadNotificationManager( }, 2000) } - private fun updateNotificationText(text: String) { + fun updateNotificationText(text: String) { notificationBuilder.run { setContentText(text) notificationManager.notify(id, this.build()) diff --git a/app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt b/app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt index 15a0f1f1bbe4..3b1469afc5d3 100644 --- a/app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt +++ b/app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt @@ -151,9 +151,9 @@ class FileDownloadWorker( override fun onStopped() { Log_OC.e(TAG, "FilesDownloadWorker stopped") - removePendingDownload(currentDownload?.user?.accountName) - cancelAllDownloads() notificationManager.dismissNotification() + cancelAllDownloads() + removePendingDownload(currentDownload?.user?.accountName) setIdleWorkerState() super.onStopped() @@ -419,6 +419,7 @@ class FileDownloadWorker( prepareForResult() if (needsToUpdateCredentials) { + updateNotificationText(context.getString(R.string.downloader_download_failed_credentials_error)) setContentIntent( intents.credentialContentIntent(download.user), PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_IMMUTABLE