X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/7a42dc2bf4e98ba9a121958f5442ae197ce65611..ff82b51e49f40155e7c340090f5ee759af2bf3ad:/src/com/owncloud/android/services/OperationsService.java diff --git a/src/com/owncloud/android/services/OperationsService.java b/src/com/owncloud/android/services/OperationsService.java index ee01c418..7667e90a 100644 --- a/src/com/owncloud/android/services/OperationsService.java +++ b/src/com/owncloud/android/services/OperationsService.java @@ -40,6 +40,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.shares.ShareType; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation; import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.operations.CreateFolderOperation; @@ -54,6 +55,7 @@ import com.owncloud.android.operations.SynchronizeFolderOperation; import com.owncloud.android.operations.UnshareLinkOperation; import android.accounts.Account; +import android.accounts.AccountManager; import android.accounts.AccountsException; import android.accounts.AuthenticatorException; import android.accounts.OperationCanceledException; @@ -352,12 +354,7 @@ public class OperationsService extends Service { return true; //Log_OC.wtf(TAG, "Sending callback later"); } else { - if (!mServiceHandler.mPendingOperations.isEmpty()) { - return true; - } else { - return false; - } - //Log_OC.wtf(TAG, "Not finished yet"); + return (!mServiceHandler.mPendingOperations.isEmpty()); } } @@ -441,7 +438,13 @@ public class OperationsService extends Service { OwnCloudAccount ocAccount = new OwnCloudAccount(mLastTarget.mAccount, mService); mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton(). - getClientFor(ocAccount, mService, MainApp.getUserAgent()); + getClientFor(ocAccount, mService); + + OwnCloudVersion version = com.owncloud.android.authentication.AccountUtils.getServerVersion( + mLastTarget.mAccount + ); + mOwnCloudClient.setOwnCloudVersion(version); + mStorageManager = new FileDataStorageManager( mLastTarget.mAccount, mService.getContentResolver() @@ -459,7 +462,7 @@ public class OperationsService extends Service { OwnCloudAccount ocAccount = new OwnCloudAccount( mLastTarget.mServerUrl, credentials); mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton(). - getClientFor(ocAccount, mService, MainApp.getUserAgent()); + getClientFor(ocAccount, mService); mStorageManager = null; } } @@ -469,7 +472,7 @@ public class OperationsService extends Service { result = ((SyncOperation)mCurrentOperation).execute(mOwnCloudClient, mStorageManager); } else { - result = mCurrentOperation.execute(mOwnCloudClient, MainApp.getUserAgent()); + result = mCurrentOperation.execute(mOwnCloudClient); } } catch (AccountsException e) {