mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:06:56 +03:00
Cancel the transfers of an account when the account is deleted: Cancel current upload
This commit is contained in:
parent
beb7d352f9
commit
3ff42b6220
1 changed files with 4 additions and 2 deletions
|
@ -76,7 +76,7 @@ public class UploadFileOperation extends RemoteOperation {
|
||||||
private String mOriginalStoragePath = null;
|
private String mOriginalStoragePath = null;
|
||||||
PutMethod mPutMethod = null;
|
PutMethod mPutMethod = null;
|
||||||
private Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
|
private Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
|
||||||
private final AtomicBoolean mCancellationRequested = new AtomicBoolean(false);
|
private AtomicBoolean mCancellationRequested = new AtomicBoolean(false);
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
private UploadRemoteFileOperation mUploadOperation;
|
private UploadRemoteFileOperation mUploadOperation;
|
||||||
|
@ -443,7 +443,9 @@ public class UploadFileOperation extends RemoteOperation {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
if (mUploadOperation != null)
|
mCancellationRequested = new AtomicBoolean(true);
|
||||||
|
if (mUploadOperation != null) {
|
||||||
mUploadOperation.cancel();
|
mUploadOperation.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue