Skip to content

Re-use the existing foreground notification for FileUploader progress notifications#6997

Merged
tobiasKaminsky merged 1 commit into
nextcloud:masterfrom
grote:4998-single-upload-notification
Sep 25, 2020
Merged

Re-use the existing foreground notification for FileUploader progress notifications#6997
tobiasKaminsky merged 1 commit into
nextcloud:masterfrom
grote:4998-single-upload-notification

Conversation

@grote

@grote grote commented Sep 23, 2020

Copy link
Copy Markdown
Member

Closes #4998

@grote
grote force-pushed the 4998-single-upload-notification branch from f6bb199 to 7717318 Compare September 23, 2020 14:25
// remove stucked notification
mNotificationManager.cancel(R.string.uploader_upload_in_progress_ticker);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be necessary anymore as we now cancel the notification when the service is destroyed.

Was this maybe a relic from before using a foreground service or did you still see that the service was killed without calling onDestroy()?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is to prevent edge cases like

  • upload ongoing, notification is shown
  • app is killed
  • notification is still shown

At least I remember something like that. Maybe it is already better handled by newer Android versions…

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably safer to leave it in then. I re-added it back.

}

mNotificationManager.cancel(R.string.uploader_upload_in_progress_ticker);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, I was replacing the progress notification with the general foreground service notification here (mNotification), but that doesn't seem to be necessary as we either cancel it when the service gets destroyed or replace it with a new notification when starting the next upload.

notifications

Signed-off-by: Torsten Grote <t@grobox.de>
@grote
grote force-pushed the 4998-single-upload-notification branch from 715b214 to 6dc30d8 Compare September 24, 2020 12:35
@nextcloud-android-bot

Copy link
Copy Markdown
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15937.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot

Copy link
Copy Markdown
Collaborator

@nextcloud-android-bot

Copy link
Copy Markdown
Collaborator

@nextcloud-android-bot

Copy link
Copy Markdown
Collaborator

Codacy

393

Lint

TypemasterPR
Warnings8080
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings27
Correctness Warnings53
Internationalization Warnings9
Multithreaded correctness Warnings9
Performance Warnings72
Security Warnings44
Dodgy code Warnings105
Total319

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings27
Correctness Warnings53
Internationalization Warnings9
Multithreaded correctness Warnings9
Performance Warnings72
Security Warnings44
Dodgy code Warnings105
Total319

@tobiasKaminsky
tobiasKaminsky merged commit 10de257 into nextcloud:master Sep 25, 2020
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.14.0 milestone Sep 25, 2020
thelittlefireman pushed a commit to thelittlefireman/android that referenced this pull request Mar 19, 2021
…ication

Re-use the existing foreground notification for FileUploader progress notifications
Signed-off-by: thelittlefireman <thelittlefireman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress Up/Download Notifications when accessed through DocumentsProvider

4 participants