X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/5b54915209ce26d977d9dabb97001ac06b24441a..265e32dee6f3d92dfde7ede23e3baa2d831923b3:/src/com/owncloud/android/files/services/FileDownloader.java diff --git a/src/com/owncloud/android/files/services/FileDownloader.java b/src/com/owncloud/android/files/services/FileDownloader.java index 2b70606c..5299b626 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -223,7 +223,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis /** * Cancels a pending or current download of a remote file. * - * @param account Owncloud account where the remote file is stored. + * @param account ownCloud account where the remote file is stored. * @param file A file in the queue of pending downloads */ public void cancel(Account account, OCFile file) { @@ -231,6 +231,12 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis download = mPendingDownloads.remove(account, file.getRemotePath()); if (download != null) { download.cancel(); + } else { + // TODO synchronize + if (mCurrentDownload.getRemotePath().startsWith(file.getRemotePath()) && + account.name.equals(mLastAccount)) { + mCurrentDownload.cancel(); + } } }