From a6a010440d881d3f9dbd2fa50d6345275c0d0a0d Mon Sep 17 00:00:00 2001 From: jabarros Date: Fri, 12 Dec 2014 09:16:32 +0100 Subject: [PATCH] Added some fixes in OperationsService --- src/com/owncloud/android/services/OperationsService.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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) { -- 2.11.0