From: jabarros Date: Fri, 12 Dec 2014 08:16:32 +0000 (+0100) Subject: Added some fixes in OperationsService X-Git-Tag: oc-android-1.7.0_signed~23^2~28^2~1 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/a6a010440d881d3f9dbd2fa50d6345275c0d0a0d?ds=inline;hp=--cc Added some fixes in OperationsService --- a6a010440d881d3f9dbd2fa50d6345275c0d0a0d diff --git a/src/com/owncloud/android/services/OperationsService.java b/src/com/owncloud/android/services/OperationsService.java index d3b6df34..008ea2ef 100644 --- a/src/com/owncloud/android/services/OperationsService.java +++ b/src/com/owncloud/android/services/OperationsService.java @@ -172,7 +172,9 @@ public class OperationsService extends Service { return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); - OCFile file = intent.getParcelableExtra(EXTRA_REMOTE_PATH); + String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); + + OCFile file = new OCFile(remotePath); Pair itemSyncKey = new Pair(account, file); Pair itemToQueue = newOperation(intent); @@ -189,7 +191,9 @@ public class OperationsService extends Service { return START_NOT_STICKY; } Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); - OCFile file = intent.getParcelableExtra(EXTRA_REMOTE_PATH); + String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); + + OCFile file = new OCFile(remotePath); // Cancel operation mSyncFolderHandler.cancel(account,file); @@ -375,7 +379,6 @@ public class OperationsService extends Service { private ConcurrentMap mPendingOperations = new ConcurrentHashMap(); - private RemoteOperation mCurrentOperation = null; private OwnCloudClient mOwnCloudClient = null; private FileDataStorageManager mStorageManager; private SynchronizeFolderOperation mCurrentSyncOperation; @@ -423,10 +426,10 @@ public class OperationsService extends Service { /// perform the operation - if (mCurrentOperation instanceof SyncOperation) { - operationResult = ((SyncOperation)mCurrentOperation).execute(mOwnCloudClient, mStorageManager); + if (mCurrentSyncOperation instanceof SyncOperation) { + operationResult = ((SyncOperation)mCurrentSyncOperation).execute(mOwnCloudClient, mStorageManager); } else { - operationResult = mCurrentOperation.execute(mOwnCloudClient); + operationResult = mCurrentSyncOperation.execute(mOwnCloudClient); } } catch (AccountsException e) {