From: masensio Date: Thu, 5 Feb 2015 08:40:09 +0000 (+0100) Subject: Cancel the transfers of an account when the account is deleted: Cancel current upload X-Git-Tag: oc-android-1.7.1_signed^2~40^2~14 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/3ff42b62208fa582cf9605e452099392ceeb2b43?hp=--cc Cancel the transfers of an account when the account is deleted: Cancel current upload --- 3ff42b62208fa582cf9605e452099392ceeb2b43 diff --git a/src/com/owncloud/android/operations/UploadFileOperation.java b/src/com/owncloud/android/operations/UploadFileOperation.java index c1445363..82ad3336 100644 --- a/src/com/owncloud/android/operations/UploadFileOperation.java +++ b/src/com/owncloud/android/operations/UploadFileOperation.java @@ -76,7 +76,7 @@ public class UploadFileOperation extends RemoteOperation { private String mOriginalStoragePath = null; PutMethod mPutMethod = null; private Set mDataTransferListeners = new HashSet(); - private final AtomicBoolean mCancellationRequested = new AtomicBoolean(false); + private AtomicBoolean mCancellationRequested = new AtomicBoolean(false); private Context mContext; private UploadRemoteFileOperation mUploadOperation; @@ -443,7 +443,9 @@ public class UploadFileOperation extends RemoteOperation { } public void cancel() { - if (mUploadOperation != null) + mCancellationRequested = new AtomicBoolean(true); + if (mUploadOperation != null) { mUploadOperation.cancel(); + } } }