projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added cancelation for subtrees
[pub/Android/ownCloud.git]
/
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
2b70606
..
5299b62
100644
(file)
--- 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.
*
/**
* Cancels a pending or current download of a remote file.
*
- * @param account
Ownc
loud account where the remote file is stored.
+ * @param account
ownC
loud account where the remote file is stored.
* @param file A file in the queue of pending downloads
*/
public void cancel(Account account, OCFile file) {
* @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();
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();
+ }
}
}
}
}