Refactor parameter user_agent out of RemoteOperation and children
authormasensio <masensio@solidgear.es>
Tue, 24 Mar 2015 13:32:13 +0000 (14:32 +0100)
committermasensio <masensio@solidgear.es>
Tue, 24 Mar 2015 13:32:13 +0000 (14:32 +0100)
27 files changed:
owncloud-android-library
src/com/owncloud/android/MainApp.java
src/com/owncloud/android/authentication/AuthenticatorAsyncTask.java
src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
src/com/owncloud/android/files/services/FileDownloader.java
src/com/owncloud/android/files/services/FileUploader.java
src/com/owncloud/android/operations/CreateFolderOperation.java
src/com/owncloud/android/operations/CreateShareOperation.java
src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java
src/com/owncloud/android/operations/DownloadFileOperation.java
src/com/owncloud/android/operations/GetServerInfoOperation.java
src/com/owncloud/android/operations/GetSharesForFileOperation.java
src/com/owncloud/android/operations/GetSharesOperation.java
src/com/owncloud/android/operations/MoveFileOperation.java
src/com/owncloud/android/operations/RefreshFolderOperation.java
src/com/owncloud/android/operations/RemoveFileOperation.java
src/com/owncloud/android/operations/RenameFileOperation.java
src/com/owncloud/android/operations/SynchronizeFileOperation.java
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
src/com/owncloud/android/operations/UnshareLinkOperation.java
src/com/owncloud/android/operations/UploadFileOperation.java
src/com/owncloud/android/operations/common/SyncOperation.java
src/com/owncloud/android/services/OperationsService.java
src/com/owncloud/android/services/SyncFolderHandler.java
src/com/owncloud/android/syncadapter/AbstractOwnCloudSyncAdapter.java
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
src/com/owncloud/android/ui/activity/FolderPickerActivity.java

index 94ac3a9..9990eeb 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 94ac3a93d3da2719c24c4f62c95e5de3e7b5e650
+Subproject commit 9990eeb7ff68dd6e3a8056768ddce93b4e04bf99
index aeaf8b3..bf82c57 100644 (file)
@@ -51,7 +51,8 @@ public class MainApp extends Application {
         MainApp.mContext = getApplicationContext();
         
         boolean isSamlAuth = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));
         MainApp.mContext = getApplicationContext();
         
         boolean isSamlAuth = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));
-        
+
+        OwnCloudClientManagerFactory.setUserAgent(getUserAgent());
         if (isSamlAuth) {   
             OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT);
             
         if (isSamlAuth) {   
             OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT);
             
index d36a1fa..4b2aed5 100644 (file)
@@ -61,8 +61,7 @@ public class AuthenticatorAsyncTask  extends AsyncTask<Object, Void, RemoteOpera
 
             // Client
             Uri uri = Uri.parse(url);
 
             // Client
             Uri uri = Uri.parse(url);
-            OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, mContext, true,
-                    MainApp.getUserAgent());
+            OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, mContext, true);
 
             client.setCredentials(credentials);
 
 
             client.setCredentials(credentials);
 
@@ -72,7 +71,7 @@ public class AuthenticatorAsyncTask  extends AsyncTask<Object, Void, RemoteOpera
                     mContext,
                     SUCCESS_IF_ABSENT
             );
                     mContext,
                     SUCCESS_IF_ABSENT
             );
-            result = operation.execute(client, MainApp.getUserAgent());
+            result = operation.execute(client);
 
         } else {
             result = new RemoteOperationResult(RemoteOperationResult.ResultCode.UNKNOWN_ERROR);
 
         } else {
             result = new RemoteOperationResult(RemoteOperationResult.ResultCode.UNKNOWN_ERROR);
index a72f509..c375f8d 100644 (file)
@@ -172,8 +172,7 @@ public class ThumbnailsCacheManager {
                     OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount,
                             MainApp.getAppContext());
                     mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
                     OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount,
                             MainApp.getAppContext());
                     mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
-                            getClientFor(ocAccount, MainApp.getAppContext(),
-                                    MainApp.getUserAgent());
+                            getClientFor(ocAccount, MainApp.getAppContext());
                 }
 
                 mFile = params[0];
                 }
 
                 mFile = params[0];
index 9d81fc4..f6d3b50 100644 (file)
@@ -466,14 +466,13 @@ public class FileDownloader extends Service
                     // of update
                     OwnCloudAccount ocAccount = new OwnCloudAccount(mCurrentAccount, this);
                     mDownloadClient = OwnCloudClientManagerFactory.getDefaultSingleton().
                     // of update
                     OwnCloudAccount ocAccount = new OwnCloudAccount(mCurrentAccount, this);
                     mDownloadClient = OwnCloudClientManagerFactory.getDefaultSingleton().
-                            getClientFor(ocAccount, this, MainApp.getUserAgent());
+                            getClientFor(ocAccount, this);
 
 
                     /// perform the download
                     /*Log_OC.v(   "NOW " + TAG + ", thread " + Thread.currentThread().getName(),
                         "Executing download of " + mCurrentDownload.getRemotePath());*/
 
 
                     /// perform the download
                     /*Log_OC.v(   "NOW " + TAG + ", thread " + Thread.currentThread().getName(),
                         "Executing download of " + mCurrentDownload.getRemotePath());*/
-                    downloadResult = mCurrentDownload.execute(mDownloadClient,
-                            MainApp.getUserAgent());
+                    downloadResult = mCurrentDownload.execute(mDownloadClient);
                     if (downloadResult.isSuccess()) {
                         saveDownloadedFile();
                     }
                     if (downloadResult.isSuccess()) {
                         saveDownloadedFile();
                     }
index 28b663b..8beff92 100644 (file)
@@ -574,7 +574,7 @@ public class FileUploader extends Service
                                 new FileDataStorageManager(mLastAccount, getContentResolver());
                         OwnCloudAccount ocAccount = new OwnCloudAccount(mLastAccount, this);
                         mUploadClient = OwnCloudClientManagerFactory.getDefaultSingleton().
                                 new FileDataStorageManager(mLastAccount, getContentResolver());
                         OwnCloudAccount ocAccount = new OwnCloudAccount(mLastAccount, this);
                         mUploadClient = OwnCloudClientManagerFactory.getDefaultSingleton().
-                                getClientFor(ocAccount, this, MainApp.getUserAgent());
+                                getClientFor(ocAccount, this);
                     }
 
                     /// check the existence of the parent folder for the file to upload
                     }
 
                     /// check the existence of the parent folder for the file to upload
@@ -587,8 +587,7 @@ public class FileUploader extends Service
                     if (grantResult.isSuccess()) {
                         OCFile parent = mStorageManager.getFileByPath(remoteParentPath);
                         mCurrentUpload.getFile().setParentId(parent.getFileId());
                     if (grantResult.isSuccess()) {
                         OCFile parent = mStorageManager.getFileByPath(remoteParentPath);
                         mCurrentUpload.getFile().setParentId(parent.getFileId());
-                        uploadResult = mCurrentUpload.execute(mUploadClient,
-                                MainApp.getUserAgent());
+                        uploadResult = mCurrentUpload.execute(mUploadClient);
                         if (uploadResult.isSuccess()) {
                             saveUploadedFile();
                         }
                         if (uploadResult.isSuccess()) {
                             saveUploadedFile();
                         }
@@ -647,7 +646,7 @@ public class FileUploader extends Service
      */
     private RemoteOperationResult grantFolderExistence(String pathToGrant) {
         RemoteOperation operation = new ExistenceCheckRemoteOperation(pathToGrant, this, false);
      */
     private RemoteOperationResult grantFolderExistence(String pathToGrant) {
         RemoteOperation operation = new ExistenceCheckRemoteOperation(pathToGrant, this, false);
-        RemoteOperationResult result = operation.execute(mUploadClient, MainApp.getUserAgent());
+        RemoteOperationResult result = operation.execute(mUploadClient);
         if (!result.isSuccess() && result.getCode() == ResultCode.FILE_NOT_FOUND &&
                 mCurrentUpload.isRemoteFolderToBeCreated()) {
             SyncOperation syncOp = new CreateFolderOperation( pathToGrant, true);
         if (!result.isSuccess() && result.getCode() == ResultCode.FILE_NOT_FOUND &&
                 mCurrentUpload.isRemoteFolderToBeCreated()) {
             SyncOperation syncOp = new CreateFolderOperation( pathToGrant, true);
@@ -708,7 +707,7 @@ public class FileUploader extends Service
         // in theory, should return the same we already have
         ReadRemoteFileOperation operation =
                 new ReadRemoteFileOperation(mCurrentUpload.getRemotePath());
         // in theory, should return the same we already have
         ReadRemoteFileOperation operation =
                 new ReadRemoteFileOperation(mCurrentUpload.getRemotePath());
-        RemoteOperationResult result = operation.execute(mUploadClient, MainApp.getUserAgent());
+        RemoteOperationResult result = operation.execute(mUploadClient);
         if (result.isSuccess()) {
             updateOCFile(file, (RemoteFile) result.getData().get(0));
             file.setLastSyncDateForProperties(syncDate);
         if (result.isSuccess()) {
             updateOCFile(file, (RemoteFile) result.getData().get(0));
             file.setLastSyncDateForProperties(syncDate);
index 263e572..b020b92 100644 (file)
@@ -61,7 +61,7 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
     protected RemoteOperationResult run(OwnCloudClient client) {
         CreateRemoteFolderOperation operation = new CreateRemoteFolderOperation(mRemotePath,
                 mCreateFullPath);
     protected RemoteOperationResult run(OwnCloudClient client) {
         CreateRemoteFolderOperation operation = new CreateRemoteFolderOperation(mRemotePath,
                 mCreateFullPath);
-        RemoteOperationResult result =  operation.execute(client, MainApp.getUserAgent());
+        RemoteOperationResult result =  operation.execute(client);
         
         if (result.isSuccess()) {
             saveFolderInDB();
         
         if (result.isSuccess()) {
             saveFolderInDB();
index e2848d5..63f7493 100644 (file)
@@ -100,12 +100,12 @@ public class CreateShareOperation extends SyncOperation {
         // Check if the share link already exists
         operation = new GetRemoteSharesForFileOperation(mPath, false, false);
         RemoteOperationResult result =
         // Check if the share link already exists
         operation = new GetRemoteSharesForFileOperation(mPath, false, false);
         RemoteOperationResult result =
-                ((GetRemoteSharesForFileOperation)operation).execute(client, MainApp.getUserAgent());
+                ((GetRemoteSharesForFileOperation)operation).execute(client);
 
         if (!result.isSuccess() || result.getData().size() <= 0) {
             operation = new CreateRemoteShareOperation(mPath, mShareType, mShareWith, mPublicUpload,
                     mPassword, mPermissions);
 
         if (!result.isSuccess() || result.getData().size() <= 0) {
             operation = new CreateRemoteShareOperation(mPath, mShareType, mShareWith, mPublicUpload,
                     mPassword, mPermissions);
-            result = ((CreateRemoteShareOperation)operation).execute(client, MainApp.getUserAgent());
+            result = ((CreateRemoteShareOperation)operation).execute(client);
         }
         
         if (result.isSuccess()) {
         }
         
         if (result.isSuccess()) {
index 7383a58..4aeff99 100644 (file)
@@ -89,12 +89,12 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation {
         client.setFollowRedirects(false);
         
         // try to access the root folder, following redirections but not SAML SSO redirections
         client.setFollowRedirects(false);
         
         // try to access the root folder, following redirections but not SAML SSO redirections
-        result = operation.execute(client, MainApp.getUserAgent());
+        result = operation.execute(client);
         String redirectedLocation = result.getRedirectedLocation(); 
         while (redirectedLocation != null && redirectedLocation.length() > 0 && 
                 !result.isIdPRedirection()) {
             client.setBaseUri(Uri.parse(result.getRedirectedLocation()));
         String redirectedLocation = result.getRedirectedLocation(); 
         while (redirectedLocation != null && redirectedLocation.length() > 0 && 
                 !result.isIdPRedirection()) {
             client.setBaseUri(Uri.parse(result.getRedirectedLocation()));
-            result = operation.execute(client, MainApp.getUserAgent());
+            result = operation.execute(client);
             redirectedLocation = result.getRedirectedLocation();
         } 
 
             redirectedLocation = result.getRedirectedLocation();
         } 
 
index 9e25bce..0cb303c 100644 (file)
@@ -150,7 +150,7 @@ public class DownloadFileOperation extends RemoteOperation {
         while (listener.hasNext()) {
             mDownloadOperation.addDatatransferProgressListener(listener.next());
         }
         while (listener.hasNext()) {
             mDownloadOperation.addDatatransferProgressListener(listener.next());
         }
-        result = mDownloadOperation.execute(client, MainApp.getUserAgent());
+        result = mDownloadOperation.execute(client);
         
         if (result.isSuccess()) {
             mModificationTimestamp = mDownloadOperation.getModificationTimestamp();
         
         if (result.isSuccess()) {
             mModificationTimestamp = mDownloadOperation.getModificationTimestamp();
index 712e7d5..8e91100 100644 (file)
@@ -79,7 +79,7 @@ public class GetServerInfoOperation extends RemoteOperation {
            
            // first: check the status of the server (including its version)
            GetRemoteStatusOperation getStatus = new GetRemoteStatusOperation(mContext);
            
            // first: check the status of the server (including its version)
            GetRemoteStatusOperation getStatus = new GetRemoteStatusOperation(mContext);
-           RemoteOperationResult result = getStatus.execute(client, MainApp.getUserAgent());
+           RemoteOperationResult result = getStatus.execute(client);
            
         if (result.isSuccess()) {
             // second: get authentication method required by the server
            
         if (result.isSuccess()) {
             // second: get authentication method required by the server
@@ -107,7 +107,7 @@ public class GetServerInfoOperation extends RemoteOperation {
         Log_OC.d(TAG, "Trying empty authorization to detect authentication method");
         DetectAuthenticationMethodOperation operation = 
                 new DetectAuthenticationMethodOperation(mContext);
         Log_OC.d(TAG, "Trying empty authorization to detect authentication method");
         DetectAuthenticationMethodOperation operation = 
                 new DetectAuthenticationMethodOperation(mContext);
-        return operation.execute(client, MainApp.getUserAgent());
+        return operation.execute(client);
     }
     
 
     }
     
 
index f6a5e06..bf136ad 100644 (file)
@@ -61,7 +61,7 @@ public class GetSharesForFileOperation extends SyncOperation {
     protected RemoteOperationResult run(OwnCloudClient client) {
         GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mPath,
                 mReshares, mSubfiles);
     protected RemoteOperationResult run(OwnCloudClient client) {
         GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mPath,
                 mReshares, mSubfiles);
-        RemoteOperationResult result = operation.execute(client, MainApp.getUserAgent());
+        RemoteOperationResult result = operation.execute(client);
 
         if (result.isSuccess()) {
 
 
         if (result.isSuccess()) {
 
index fe9fd5c..09a8e34 100644 (file)
@@ -43,7 +43,7 @@ public class GetSharesOperation extends SyncOperation {
     @Override
     protected RemoteOperationResult run(OwnCloudClient client) {
         GetRemoteSharesOperation operation = new GetRemoteSharesOperation();
     @Override
     protected RemoteOperationResult run(OwnCloudClient client) {
         GetRemoteSharesOperation operation = new GetRemoteSharesOperation();
-        RemoteOperationResult result = operation.execute(client, MainApp.getUserAgent());
+        RemoteOperationResult result = operation.execute(client);
 
         if (result.isSuccess()) {
 
 
         if (result.isSuccess()) {
 
index 6afc37b..be254e7 100644 (file)
@@ -90,7 +90,7 @@ public class MoveFileOperation extends SyncOperation {
                 targetPath, 
                 false
         );
                 targetPath, 
                 false
         );
-        result = operation.execute(client, MainApp.getUserAgent());
+        result = operation.execute(client);
         
         /// 3. local move
         if (result.isSuccess()) {
         
         /// 3. local move
         if (result.isSuccess()) {
index 251409a..50a35fd 100644 (file)
@@ -228,7 +228,7 @@ public class RefreshFolderOperation extends RemoteOperation {
 
     private void updateOCVersion(OwnCloudClient client) {
         UpdateOCVersionOperation update = new UpdateOCVersionOperation(mAccount, mContext);
 
     private void updateOCVersion(OwnCloudClient client) {
         UpdateOCVersionOperation update = new UpdateOCVersionOperation(mAccount, mContext);
-        RemoteOperationResult result = update.execute(client, MainApp.getUserAgent());
+        RemoteOperationResult result = update.execute(client);
         if (result.isSuccess()) {
             mIsShareSupported = update.getOCVersion().isSharedSupported();
         }
         if (result.isSuccess()) {
             mIsShareSupported = update.getOCVersion().isSharedSupported();
         }
@@ -245,7 +245,7 @@ public class RefreshFolderOperation extends RemoteOperation {
         
         // remote request 
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
         
         // remote request 
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
-        result = operation.execute(client, MainApp.getUserAgent());
+        result = operation.execute(client);
         if (result.isSuccess()){
             OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
 
         if (result.isSuccess()){
             OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
 
@@ -281,7 +281,7 @@ public class RefreshFolderOperation extends RemoteOperation {
     private RemoteOperationResult fetchAndSyncRemoteFolder(OwnCloudClient client) {
         String remotePath = mLocalFolder.getRemotePath();
         ReadRemoteFolderOperation operation = new ReadRemoteFolderOperation(remotePath);
     private RemoteOperationResult fetchAndSyncRemoteFolder(OwnCloudClient client) {
         String remotePath = mLocalFolder.getRemotePath();
         ReadRemoteFolderOperation operation = new ReadRemoteFolderOperation(remotePath);
-        RemoteOperationResult result = operation.execute(client, MainApp.getUserAgent());
+        RemoteOperationResult result = operation.execute(client);
         Log_OC.d(TAG, "Synchronizing " + mAccount.name + remotePath);
         
         if (result.isSuccess()) {
         Log_OC.d(TAG, "Synchronizing " + mAccount.name + remotePath);
         
         if (result.isSuccess()) {
@@ -549,7 +549,7 @@ public class RefreshFolderOperation extends RemoteOperation {
         // remote request 
         GetRemoteSharesForFileOperation operation = 
                 new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), false, true);
         // remote request 
         GetRemoteSharesForFileOperation operation = 
                 new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), false, true);
-        result = operation.execute(client, MainApp.getUserAgent());
+        result = operation.execute(client);
         
         if (result.isSuccess()) {
             // update local database
         
         if (result.isSuccess()) {
             // update local database
index c77fcd3..012ef23 100644 (file)
@@ -79,7 +79,7 @@ public class RemoveFileOperation extends SyncOperation {
         boolean localRemovalFailed = false;
         if (!mOnlyLocalCopy) {
             RemoveRemoteFileOperation operation = new RemoveRemoteFileOperation(mRemotePath);
         boolean localRemovalFailed = false;
         if (!mOnlyLocalCopy) {
             RemoveRemoteFileOperation operation = new RemoveRemoteFileOperation(mRemotePath);
-            result = operation.execute(client, MainApp.getUserAgent());
+            result = operation.execute(client);
             if (result.isSuccess() || result.getCode() == ResultCode.FILE_NOT_FOUND) {
                 localRemovalFailed = !(getStorageManager().removeFile(mFileToRemove, true, true));
             }
             if (result.isSuccess() || result.getCode() == ResultCode.FILE_NOT_FOUND) {
                 localRemovalFailed = !(getStorageManager().removeFile(mFileToRemove, true, true));
             }
index f678719..a4cfa02 100644 (file)
@@ -99,7 +99,7 @@ public class RenameFileOperation extends SyncOperation {
             RenameRemoteFileOperation operation = new RenameRemoteFileOperation(mFile.getFileName(),
                     mFile.getRemotePath(),
                     mNewName, mFile.isFolder());
             RenameRemoteFileOperation operation = new RenameRemoteFileOperation(mFile.getFileName(),
                     mFile.getRemotePath(),
                     mNewName, mFile.isFolder());
-            result = operation.execute(client, MainApp.getUserAgent());
+            result = operation.execute(client);
 
             if (result.isSuccess()) {
                 if (mFile.isFolder()) {
 
             if (result.isSuccess()) {
                 if (mFile.isFolder()) {
index 08481d1..27b0b5a 100644 (file)
@@ -197,7 +197,7 @@ public class SynchronizeFileOperation extends SyncOperation {
 
             if (mServerFile == null) {
                 ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mRemotePath);
 
             if (mServerFile == null) {
                 ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mRemotePath);
-                result = operation.execute(client, MainApp.getUserAgent());
+                result = operation.execute(client);
                 if (result.isSuccess()){
                     mServerFile = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
                     mServerFile.setLastSyncDateForProperties(System.currentTimeMillis());
                 if (result.isSuccess()){
                     mServerFile = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
                     mServerFile.setLastSyncDateForProperties(System.currentTimeMillis());
index c45e134..286b5ea 100644 (file)
@@ -189,7 +189,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
         
         // remote request
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mRemotePath);
         
         // remote request
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mRemotePath);
-        result = operation.execute(client, MainApp.getUserAgent());
+        result = operation.execute(client);
         if (result.isSuccess()){
             OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
 
         if (result.isSuccess()){
             OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
 
@@ -228,7 +228,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
         }
         
         ReadRemoteFolderOperation operation = new ReadRemoteFolderOperation(mRemotePath);
         }
         
         ReadRemoteFolderOperation operation = new ReadRemoteFolderOperation(mRemotePath);
-        RemoteOperationResult result = operation.execute(client, MainApp.getUserAgent());
+        RemoteOperationResult result = operation.execute(client);
         Log_OC.d(TAG, "Synchronizing " + mAccount.name + mRemotePath);
 
         if (result.isSuccess()) {
         Log_OC.d(TAG, "Synchronizing " + mAccount.name + mRemotePath);
 
         if (result.isSuccess()) {
index 098d7c0..1b66226 100644 (file)
@@ -64,7 +64,7 @@ public class UnshareLinkOperation extends SyncOperation {
         if (share != null) {
             RemoveRemoteShareOperation operation =
                     new RemoveRemoteShareOperation((int) share.getIdRemoteShared());
         if (share != null) {
             RemoveRemoteShareOperation operation =
                     new RemoveRemoteShareOperation((int) share.getIdRemoteShared());
-            result = operation.execute(client, MainApp.getUserAgent());
+            result = operation.execute(client);
 
             if (result.isSuccess() || result.getCode() == ResultCode.SHARE_NOT_FOUND) {
                 Log_OC.d(TAG, "Share id = " + share.getIdRemoteShared() + " deleted");
 
             if (result.isSuccess() || result.getCode() == ResultCode.SHARE_NOT_FOUND) {
                 Log_OC.d(TAG, "Share id = " + share.getIdRemoteShared() + " deleted");
@@ -94,7 +94,7 @@ public class UnshareLinkOperation extends SyncOperation {
     private boolean existsFile(OwnCloudClient client, String remotePath){
         ExistenceCheckRemoteOperation existsOperation =
                 new ExistenceCheckRemoteOperation(remotePath, mContext, false);
     private boolean existsFile(OwnCloudClient client, String remotePath){
         ExistenceCheckRemoteOperation existsOperation =
                 new ExistenceCheckRemoteOperation(remotePath, mContext, false);
-        RemoteOperationResult result = existsOperation.execute(client, MainApp.getUserAgent());
+        RemoteOperationResult result = existsOperation.execute(client);
         return result.isSuccess();
     }
 
         return result.isSuccess();
     }
 
index d531618..b114195 100644 (file)
@@ -322,7 +322,7 @@ public class UploadFileOperation extends RemoteOperation {
                 mUploadOperation.addDatatransferProgressListener(listener.next());
             }
             if (!mCancellationRequested.get()) {
                 mUploadOperation.addDatatransferProgressListener(listener.next());
             }
             if (!mCancellationRequested.get()) {
-                result = mUploadOperation.execute(client, MainApp.getUserAgent());
+                result = mUploadOperation.execute(client);
 
                 /// move local temporal file or original file to its corresponding
                 // location in the ownCloud local folder
 
                 /// move local temporal file or original file to its corresponding
                 // location in the ownCloud local folder
@@ -459,7 +459,7 @@ public class UploadFileOperation extends RemoteOperation {
     private boolean existsFile(OwnCloudClient client, String remotePath){
         ExistenceCheckRemoteOperation existsOperation =
                 new ExistenceCheckRemoteOperation(remotePath, mContext, false);
     private boolean existsFile(OwnCloudClient client, String remotePath){
         ExistenceCheckRemoteOperation existsOperation =
                 new ExistenceCheckRemoteOperation(remotePath, mContext, false);
-        RemoteOperationResult result = existsOperation.execute(client, MainApp.getUserAgent());
+        RemoteOperationResult result = existsOperation.execute(client);
         return result.isSuccess();
     }
     
         return result.isSuccess();
     }
     
index 86b433b..5fb5c8c 100644 (file)
@@ -70,7 +70,7 @@ public abstract class SyncOperation extends RemoteOperation {
                     "storage manager for a NULL account");
         }
         mStorageManager = storageManager;
                     "storage manager for a NULL account");
         }
         mStorageManager = storageManager;
-        return super.execute(mStorageManager.getAccount(), context, getUserAgent());
+        return super.execute(mStorageManager.getAccount(), context);
     }
     
        
     }
     
        
@@ -90,7 +90,7 @@ public abstract class SyncOperation extends RemoteOperation {
             throw new IllegalArgumentException("Trying to execute a sync operation with a " +
                     "NULL storage manager");
         mStorageManager = storageManager;
             throw new IllegalArgumentException("Trying to execute a sync operation with a " +
                     "NULL storage manager");
         mStorageManager = storageManager;
-               return super.execute(client, MainApp.getUserAgent());
+               return super.execute(client);
        }
 
        
        }
 
        
@@ -143,7 +143,7 @@ public abstract class SyncOperation extends RemoteOperation {
                     "with a NULL storage manager");
         }
         mStorageManager = storageManager;
                     "with a NULL storage manager");
         }
         mStorageManager = storageManager;
-        return super.execute(client, MainApp.getUserAgent(), listener, listenerHandler);
+        return super.execute(client, listener, listenerHandler);
        }
 
        
        }
 
        
index ee01c41..fcaf0c7 100644 (file)
@@ -441,7 +441,7 @@ public class OperationsService extends Service {
                             OwnCloudAccount ocAccount = new OwnCloudAccount(mLastTarget.mAccount,
                                     mService);
                             mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
                             OwnCloudAccount ocAccount = new OwnCloudAccount(mLastTarget.mAccount,
                                     mService);
                             mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
-                                    getClientFor(ocAccount, mService, MainApp.getUserAgent());
+                                    getClientFor(ocAccount, mService);
                             mStorageManager = new FileDataStorageManager(
                                     mLastTarget.mAccount, 
                                     mService.getContentResolver()
                             mStorageManager = new FileDataStorageManager(
                                     mLastTarget.mAccount, 
                                     mService.getContentResolver()
@@ -459,7 +459,7 @@ public class OperationsService extends Service {
                             OwnCloudAccount ocAccount = new OwnCloudAccount(
                                     mLastTarget.mServerUrl, credentials);
                             mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
                             OwnCloudAccount ocAccount = new OwnCloudAccount(
                                     mLastTarget.mServerUrl, credentials);
                             mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
-                                    getClientFor(ocAccount, mService, MainApp.getUserAgent());
+                                    getClientFor(ocAccount, mService);
                             mStorageManager = null;
                         }
                     }
                             mStorageManager = null;
                         }
                     }
@@ -469,7 +469,7 @@ public class OperationsService extends Service {
                         result = ((SyncOperation)mCurrentOperation).execute(mOwnCloudClient,
                                 mStorageManager);
                     } else {
                         result = ((SyncOperation)mCurrentOperation).execute(mOwnCloudClient,
                                 mStorageManager);
                     } else {
-                        result = mCurrentOperation.execute(mOwnCloudClient, MainApp.getUserAgent());
+                        result = mCurrentOperation.execute(mOwnCloudClient);
                     }
                     
                 } catch (AccountsException e) {
                     }
                     
                 } catch (AccountsException e) {
index e76a2dc..33318f5 100644 (file)
@@ -118,7 +118,7 @@ class SyncFolderHandler extends Handler {
                 // always get client from client manager, to get fresh credentials in case of update
                 OwnCloudAccount ocAccount = new OwnCloudAccount(account, mService);
                 mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
                 // always get client from client manager, to get fresh credentials in case of update
                 OwnCloudAccount ocAccount = new OwnCloudAccount(account, mService);
                 mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
-                        getClientFor(ocAccount, mService, MainApp.getUserAgent());
+                        getClientFor(ocAccount, mService);
 
                 result = mCurrentSyncOperation.execute(mOwnCloudClient, mStorageManager);
 
 
                 result = mCurrentSyncOperation.execute(mOwnCloudClient, mStorageManager);
 
index e17cf8d..4740310 100644 (file)
@@ -108,7 +108,7 @@ public abstract class AbstractOwnCloudSyncAdapter extends
         AccountUtils.constructFullURLForAccount(getContext(), account);\r
         OwnCloudAccount ocAccount = new OwnCloudAccount(account, getContext());\r
         mClient = OwnCloudClientManagerFactory.getDefaultSingleton().\r
         AccountUtils.constructFullURLForAccount(getContext(), account);\r
         OwnCloudAccount ocAccount = new OwnCloudAccount(account, getContext());\r
         mClient = OwnCloudClientManagerFactory.getDefaultSingleton().\r
-                getClientFor(ocAccount, getContext(), MainApp.getUserAgent());\r
+                getClientFor(ocAccount, getContext());\r
     }\r
     \r
     protected OwnCloudClient getClient() {\r
     }\r
     \r
     protected OwnCloudClient getClient() {\r
index 8902454..43ddae3 100644 (file)
@@ -228,7 +228,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
      * locally saved. 
      * 
      * See {@link #onPerformSync(Account, Bundle, String, ContentProviderClient, SyncResult)}
      * locally saved. 
      * 
      * See {@link #onPerformSync(Account, Bundle, String, ContentProviderClient, SyncResult)}
-     * and {@link #synchronizeFolder(String, long)}.
+     * and {@link #synchronizeFolder(OCFile)}.
      */
     @Override
     public void onSyncCanceled() {
      */
     @Override
     public void onSyncCanceled() {
@@ -243,7 +243,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
      */
     private void updateOCVersion() {
         UpdateOCVersionOperation update = new UpdateOCVersionOperation(getAccount(), getContext());
      */
     private void updateOCVersion() {
         UpdateOCVersionOperation update = new UpdateOCVersionOperation(getAccount(), getContext());
-        RemoteOperationResult result = update.execute(getClient(), MainApp.getUserAgent());
+        RemoteOperationResult result = update.execute(getClient());
         if (!result.isSuccess()) {
             mLastFailedResult = result; 
         } else {
         if (!result.isSuccess()) {
             mLastFailedResult = result; 
         } else {
@@ -288,7 +288,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
                                                                                    getAccount(),
                                                                                    getContext()
                                                                                   );
                                                                                    getAccount(),
                                                                                    getContext()
                                                                                   );
-        RemoteOperationResult result = synchFolderOp.execute(getClient(), MainApp.getUserAgent());
+        RemoteOperationResult result = synchFolderOp.execute(getClient());
         
         
         // synchronized folder -> notice to UI - ALWAYS, although !result.isSuccess
         
         
         // synchronized folder -> notice to UI - ALWAYS, although !result.isSuccess
index 82744fd..62299f2 100644 (file)
@@ -220,7 +220,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
                                                                         getAccount(), 
                                                                         getApplicationContext()
                                                                       );
                                                                         getAccount(), 
                                                                         getApplicationContext()
                                                                       );
-        synchFolderOp.execute(getAccount(), this, MainApp.getUserAgent(), null, null);
+        synchFolderOp.execute(getAccount(), this, null, null);
         
         setSupportProgressBarIndeterminateVisibility(true);
 
         
         setSupportProgressBarIndeterminateVisibility(true);