From 931aac7345adcae13068a6cfa8090c5516f0fd0a Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Mon, 5 Oct 2020 13:21:56 -0300 Subject: [PATCH] Ensure that upload notification gets cancelled Normally, the notification gets cancelled when the service is destroyed. But that does not always happen in practice, so we also cancel it after every result. Signed-off-by: Torsten Grote --- .../java/com/owncloud/android/files/services/FileUploader.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/owncloud/android/files/services/FileUploader.java b/src/main/java/com/owncloud/android/files/services/FileUploader.java index 8f8f7332bc42..d89c52260a30 100644 --- a/src/main/java/com/owncloud/android/files/services/FileUploader.java +++ b/src/main/java/com/owncloud/android/files/services/FileUploader.java @@ -751,6 +751,8 @@ private void notifyUploadResult(UploadFileOperation upload, RemoteOperationResul mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); } + mNotificationManager.cancel(FOREGROUND_SERVICE_ID); + // Only notify if the upload fails if (!uploadResult.isCancelled() && !uploadResult.isSuccess() &&