Merge pull request #812 from owncloud/download_folder__update_contextual_menu_asap

Allow cancelling download of folders as soon as the SynchronizeFolderOpe...
This commit is contained in:
jabarros 2014-12-17 09:47:18 +01:00
commit 732ab432a4

View file

@ -31,6 +31,7 @@ import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
import com.owncloud.android.ui.activity.ComponentsGetter;
/**
@ -141,6 +142,8 @@ public class FileMenuFilter {
if (mComponentsGetter != null && mFile != null && mAccount != null) {
FileDownloaderBinder downloaderBinder = mComponentsGetter.getFileDownloaderBinder();
downloading = downloaderBinder != null && downloaderBinder.isDownloading(mAccount, mFile);
OperationsServiceBinder opsBinder = mComponentsGetter.getOperationsServiceBinder();
downloading |= (opsBinder != null && opsBinder.isSynchronizing(mAccount, mFile.getRemotePath()));
FileUploaderBinder uploaderBinder = mComponentsGetter.getFileUploaderBinder();
uploading = uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile);
}