Skip to content

Commit eec4096

Browse files
author
zerox80
committed
Revert "fix: remove stale foreground cancellation in upload worker"
This reverts commit 5c1103f.
1 parent 5c1103f commit eec4096

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

opencloudApp/src/main/java/eu/opencloud/android/workers/UploadFileFromFileSystemWorker.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,6 @@ class UploadFileFromFileSystemWorker(
327327
}
328328

329329
private fun updateProgressFromTus(offset: Long, totalSize: Long) {
330-
if (this.isStopped) {
331-
Timber.w("Cancelling TUS upload. The worker is stopped by user or system")
332-
tusUploadHelper.cancel()
333-
}
334-
335330
if (totalSize <= 0) return
336331
val percent: Int = (100.0 * offset.toDouble() / totalSize.toDouble()).toInt()
337332
if (percent == lastPercent) return
@@ -451,14 +446,6 @@ class UploadFileFromFileSystemWorker(
451446
totalToTransfer: Long,
452447
filePath: String
453448
) {
454-
if (this.isStopped) {
455-
Timber.w("Cancelling upload operation. The worker is stopped by user or system")
456-
if (::uploadFileOperation.isInitialized) {
457-
uploadFileOperation.cancel()
458-
uploadFileOperation.removeDataTransferProgressListener(this)
459-
}
460-
}
461-
462449
val percent: Int = (100.0 * totalTransferredSoFar.toDouble() / totalToTransfer.toDouble()).toInt()
463450
if (percent == lastPercent) return
464451

0 commit comments

Comments
 (0)