Commit 8a1d88c4 authored by Sylvain Berfini's avatar Sylvain Berfini :cow:
Browse files

Prevent file transfer notification being still displayed after all transfer have ended

1 merge request!1497Prevent file transfer notification being still displayed after all transfer have ended
Pipeline #82472 passed with stage
in 5 minutes and 9 seconds
Showing with 5 additions and 3 deletions
......@@ -121,6 +121,10 @@ class CoreFileTransferService : FileTransferService() {
Log.i(
"$TAG [$downloadingFilesCount] file(s) being downloaded, [$uploadingFilesCount] file(s) being uploaded"
)
if (downloadingFilesCount == 0 && uploadingFilesCount == 0) {
Log.i("$TAG No more files being transferred, do not alter the notification")
return
}
val downloadText = resources.getQuantityString(
R.plurals.notification_file_transfer_download,
......@@ -141,10 +145,8 @@ class CoreFileTransferService : FileTransferService() {
)
} else if (downloadingFilesCount > 0) {
downloadText
} else if (uploadingFilesCount > 0) {
uploadText
} else {
getString(R.string.notification_file_transfer_startup_message)
uploadText
}
mServiceNotification = builder.setContentText(message).build()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment