diff --git a/app/src/main/java/com/nextcloud/client/jobs/FilesUploadWorker.kt b/app/src/main/java/com/nextcloud/client/jobs/FilesUploadWorker.kt index 463c3a5f1c..c01849692e 100644 --- a/app/src/main/java/com/nextcloud/client/jobs/FilesUploadWorker.kt +++ b/app/src/main/java/com/nextcloud/client/jobs/FilesUploadWorker.kt @@ -71,7 +71,6 @@ class FilesUploadWorker( private val notificationManager = UploadNotificationManager(context, viewThemeUtils) private val intents = FileUploaderIntents(context) private val fileUploaderDelegate = FileUploaderDelegate() - private val helper = FilesUploadHelper() override fun doWork(): Result { backgroundJobManager.logStartOfWorker(BackgroundJobManagerImpl.formatClassTag(this::class)) diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java b/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java index 665d5fa1fc..6b749be661 100755 --- a/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java +++ b/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java @@ -95,6 +95,8 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter { switch (group.type) { case CURRENT -> { - FilesUploadHelper uploadHelper = parentActivity.getFileUploaderHelper(); - if (uploadHelper != null) { - for (OCUpload upload : group.getItems()) { - uploadHelper.cancelFileUpload(upload.getRemotePath(), upload.getAccountName()); - } + for (OCUpload upload : group.getItems()) { + uploadHelper.cancelFileUpload(upload.getRemotePath(), upload.getAccountName()); } } case FINISHED -> uploadsStorageManager.clearSuccessfulUploads(); @@ -139,8 +138,7 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter { } // do nothing @@ -270,44 +268,41 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter { - FilesUploadHelper uploadHelper = parentActivity.getFileUploaderHelper(); - if (uploadHelper != null) { - uploadHelper.cancelFileUpload(item.getRemotePath(), item.getAccountName()); - loadUploadItemsFromDb(); - } + uploadHelper.cancelFileUpload(item.getRemotePath(), item.getAccountName()); + loadUploadItemsFromDb(); }); } else if (item.getUploadStatus() == UploadStatus.UPLOAD_FAILED) { @@ -374,7 +366,7 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter user = accountManager.getUser(item.getAccountName()); if (file.exists() && user.isPresent()) { - new FilesUploadHelper().retryUpload(item, user.get()); + uploadHelper.retryUpload(item, user.get()); loadUploadItemsFromDb(); } else { DisplayUtils.showSnackMessage( @@ -619,14 +611,11 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter