Skip to content

Commit

Permalink
Add credentials error notification
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Jan 8, 2024
1 parent 6083552 commit 25b6804
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 25b6804

Please sign in to comment.