Эх сурвалжийг харах

Migrate RemoteOperation.execute calls to User

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
Chris Narkiewicz 2 жил өмнө
parent
commit
35e164fa2d
28 өөрчлөгдсөн 51 нэмэгдсэн , 57 устгасан
  1. 2 2
      app/src/androidTest/java/com/nextcloud/client/EndToEndRandomIT.java
  2. 1 1
      app/src/androidTest/java/com/owncloud/android/DownloadIT.java
  3. 2 2
      app/src/androidTest/java/com/owncloud/android/FileIT.java
  4. 2 2
      app/src/androidTest/java/com/owncloud/android/UploadIT.java
  5. 4 4
      app/src/androidTest/java/com/owncloud/android/operations/RemoveFileOperationIT.java
  6. 1 1
      app/src/androidTest/java/com/owncloud/android/util/ErrorMessageAdapterIT.java
  7. 3 3
      app/src/main/java/com/nextcloud/client/account/User.kt
  8. 1 1
      app/src/main/java/com/nextcloud/client/jobs/OfflineSyncWork.kt
  9. 1 1
      app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java
  10. 1 1
      app/src/main/java/com/owncloud/android/operations/CreateFolderOperation.java
  11. 5 5
      app/src/main/java/com/owncloud/android/operations/RemoveFileOperation.java
  12. 5 5
      app/src/main/java/com/owncloud/android/operations/RemoveRemoteEncryptedFileOperation.java
  13. 2 2
      app/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java
  14. 1 1
      app/src/main/java/com/owncloud/android/services/OperationsService.java
  15. 1 1
      app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java
  16. 1 1
      app/src/main/java/com/owncloud/android/ui/activity/RichDocumentsEditorWebView.java
  17. 1 1
      app/src/main/java/com/owncloud/android/ui/activity/ShareActivity.java
  18. 1 1
      app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java
  19. 1 1
      app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java
  20. 3 4
      app/src/main/java/com/owncloud/android/ui/asynctasks/FetchRemoteFileTask.java
  21. 1 2
      app/src/main/java/com/owncloud/android/ui/asynctasks/GallerySearchTask.java
  22. 4 5
      app/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java
  23. 1 1
      app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java
  24. 1 3
      app/src/main/java/com/owncloud/android/ui/fragment/OCFileListSearchAsyncTask.kt
  25. 1 2
      app/src/main/java/com/owncloud/android/ui/fragment/SharedListFragment.kt
  26. 1 1
      app/src/main/java/com/owncloud/android/ui/fragment/contactsbackup/BackupFragment.java
  27. 2 2
      app/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java
  28. 1 1
      app/src/main/java/com/owncloud/android/ui/preview/PreviewTextStringFragment.java

+ 2 - 2
app/src/androidTest/java/com/nextcloud/client/EndToEndRandomIT.java

@@ -468,7 +468,7 @@ public class EndToEndRandomIT extends AbstractOnServerIT {
 
         assertTrue(new RemoveFileOperation(fileToDelete,
                                            false,
-                                           account,
+                                           user,
                                            false,
                                            targetContext,
                                            getStorageManager())
@@ -621,7 +621,7 @@ public class EndToEndRandomIT extends AbstractOnServerIT {
                 Log_OC.d(this, "Remove file: " + child.getDecryptedRemotePath());
             }
 
-            assertTrue(new RemoveFileOperation(child, false, account, false, targetContext, getStorageManager())
+            assertTrue(new RemoveFileOperation(child, false, user, false, targetContext, getStorageManager())
                            .execute(client)
                            .isSuccess()
                       );

+ 1 - 1
app/src/androidTest/java/com/owncloud/android/DownloadIT.java

@@ -63,7 +63,7 @@ public class DownloadIT extends AbstractOnServerIT {
         if (result.isSuccess() && getStorageManager().getFileByDecryptedRemotePath(FOLDER) != null) {
             new RemoveFileOperation(getStorageManager().getFileByDecryptedRemotePath(FOLDER),
                                     false,
-                                    account,
+                                    user,
                                     false,
                                     targetContext,
                                     getStorageManager())

+ 2 - 2
app/src/androidTest/java/com/owncloud/android/FileIT.java

@@ -38,7 +38,7 @@ public class FileIT extends AbstractOnServerIT {
         assertTrue(file.isFolder());
 
         // cleanup
-        new RemoveFileOperation(file, false, account, false, targetContext, getStorageManager()).execute(client);
+        new RemoveFileOperation(file, false, user, false, targetContext, getStorageManager()).execute(client);
     }
 
     @Test
@@ -58,7 +58,7 @@ public class FileIT extends AbstractOnServerIT {
         // cleanup
         new RemoveFileOperation(file,
                                 false,
-                                account,
+                                user,
                                 false,
                                 targetContext,
                                 getStorageManager())

+ 2 - 2
app/src/androidTest/java/com/owncloud/android/UploadIT.java

@@ -116,7 +116,7 @@ public class UploadIT extends AbstractOnServerIT {
         if (result.isSuccess() && getStorageManager().getFileByDecryptedRemotePath(FOLDER) != null) {
             new RemoveFileOperation(getStorageManager().getFileByDecryptedRemotePath(FOLDER),
                                     false,
-                                    account,
+                                    user,
                                     false,
                                     targetContext,
                                     getStorageManager())
@@ -371,7 +371,7 @@ public class UploadIT extends AbstractOnServerIT {
         // cleanup
         new RemoveFileOperation(getStorageManager().getFileByDecryptedRemotePath(FOLDER),
                                 false,
-                                account,
+                                user,
                                 false,
                                 targetContext,
                                 getStorageManager())

+ 4 - 4
app/src/androidTest/java/com/owncloud/android/operations/RemoveFileOperationIT.java

@@ -47,7 +47,7 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
 
         assertTrue(new RemoveFileOperation(folder,
                                            false,
-                                           account,
+                                           user,
                                            false,
                                            targetContext,
                                            getStorageManager())
@@ -59,7 +59,7 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
         assertNotNull(parentFolder);
         assertTrue(new RemoveFileOperation(parentFolder,
                                            false,
-                                           account,
+                                           user,
                                            false,
                                            targetContext,
                                            getStorageManager())
@@ -81,7 +81,7 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
 
         assertTrue(new RemoveFileOperation(file,
                                            false,
-                                           account,
+                                           user,
                                            false,
                                            targetContext,
                                            getStorageManager())
@@ -93,7 +93,7 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
         assertNotNull(parentFolder);
         assertTrue(new RemoveFileOperation(parentFolder,
                                            false,
-                                           account,
+                                           user,
                                            false,
                                            targetContext,
                                            getStorageManager())

+ 1 - 1
app/src/androidTest/java/com/owncloud/android/util/ErrorMessageAdapterIT.java

@@ -58,7 +58,7 @@ public class ErrorMessageAdapterIT {
             new RemoteOperationResult(RemoteOperationResult.ResultCode.FORBIDDEN),
             new RemoveFileOperation(new OCFile(PATH_TO_DELETE),
                                     false,
-                                    user.toPlatformAccount(),
+                                    user,
                                     false,
                                     context,
                                     new FileDataStorageManager(user, context.getContentResolver())),

+ 3 - 3
app/src/main/java/com/nextcloud/client/account/User.kt

@@ -24,8 +24,8 @@ import android.accounts.Account
 import android.os.Parcelable
 import com.owncloud.android.lib.common.OwnCloudAccount
 
-interface User : Parcelable {
-    val accountName: String
+interface User : Parcelable, com.nextcloud.common.User {
+    override val accountName: String
     val server: Server
     val isAnonymous: Boolean
 
@@ -39,7 +39,7 @@ interface User : Parcelable {
      * @return Account instance that is associated with this User object.
      */
     @Deprecated("Temporary workaround")
-    fun toPlatformAccount(): Account
+    override fun toPlatformAccount(): Account
 
     /**
      * This is temporary helper method created to facilitate incremental refactoring.

+ 1 - 1
app/src/main/java/com/nextcloud/client/jobs/OfflineSyncWork.kt

@@ -88,7 +88,7 @@ class OfflineSyncWork constructor(
             ocFolder.remotePath,
             ocFolder.etagOnServer
         )
-        val result = checkEtagOperation.execute(user.toPlatformAccount(), context)
+        val result = checkEtagOperation.execute(user, context)
         when (result.code) {
             ResultCode.ETAG_UNCHANGED -> {
                 Log_OC.d(TAG, "$folderName: eTag unchanged")

+ 1 - 1
app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java

@@ -278,7 +278,7 @@ public class FileDataStorageManager {
                 // remote request
                 ReadFileRemoteOperation operation = new ReadFileRemoteOperation(parentPath);
                 // TODO Deprecated
-                RemoteOperationResult result = operation.execute(getUser().toPlatformAccount(), context);
+                RemoteOperationResult result = operation.execute(getUser(), context);
                 if (result.isSuccess()) {
                     OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
 

+ 1 - 1
app/src/main/java/com/owncloud/android/operations/CreateFolderOperation.java

@@ -202,7 +202,7 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
             if (encryptedRemotePath != null) {
                 RemoteOperationResult removeResult = new RemoveRemoteEncryptedFileOperation(encryptedRemotePath,
                                                                                             parent.getLocalId(),
-                                                                                            user.toPlatformAccount(),
+                                                                                            user,
                                                                                             context,
                                                                                             filename).execute(client);
 

+ 5 - 5
app/src/main/java/com/owncloud/android/operations/RemoveFileOperation.java

@@ -22,9 +22,9 @@
 
 package com.owncloud.android.operations;
 
-import android.accounts.Account;
 import android.content.Context;
 
+import com.nextcloud.client.account.User;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.datamodel.ThumbnailsCacheManager;
@@ -44,7 +44,7 @@ public class RemoveFileOperation extends SyncOperation {
 
     private final OCFile fileToRemove;
     private final boolean onlyLocalCopy;
-    private final Account account;
+    private final User user;
     private final boolean inBackground;
     private final Context context;
 
@@ -57,7 +57,7 @@ public class RemoveFileOperation extends SyncOperation {
      */
     public RemoveFileOperation(OCFile fileToRemove,
                                boolean onlyLocalCopy,
-                               Account account,
+                               User user,
                                boolean inBackground,
                                Context context,
                                FileDataStorageManager storageManager) {
@@ -65,7 +65,7 @@ public class RemoveFileOperation extends SyncOperation {
 
         this.fileToRemove = fileToRemove;
         this.onlyLocalCopy = onlyLocalCopy;
-        this.account = account;
+        this.user = user;
         this.inBackground = inBackground;
         this.context = context;
     }
@@ -105,7 +105,7 @@ public class RemoveFileOperation extends SyncOperation {
                 OCFile parent = getStorageManager().getFileByPath(fileToRemove.getParentRemotePath());
                 operation = new RemoveRemoteEncryptedFileOperation(fileToRemove.getRemotePath(),
                                                                    parent.getLocalId(),
-                                                                   account,
+                                                                   user,
                                                                    context,
                                                                    fileToRemove.getEncryptedFileName());
             } else {

+ 5 - 5
app/src/main/java/com/owncloud/android/operations/RemoveRemoteEncryptedFileOperation.java

@@ -21,10 +21,10 @@
 
 package com.owncloud.android.operations;
 
-import android.accounts.Account;
 import android.content.Context;
 
 import com.google.gson.reflect.TypeToken;
+import com.nextcloud.client.account.User;
 import com.owncloud.android.datamodel.ArbitraryDataProvider;
 import com.owncloud.android.datamodel.DecryptedFolderMetadata;
 import com.owncloud.android.datamodel.EncryptedFolderMetadata;
@@ -63,7 +63,7 @@ public class RemoveRemoteEncryptedFileOperation extends RemoteOperation {
 
     private String remotePath;
     private String parentId;
-    private Account account;
+    private User user;
 
     private ArbitraryDataProvider arbitraryDataProvider;
     private String fileName;
@@ -76,12 +76,12 @@ public class RemoveRemoteEncryptedFileOperation extends RemoteOperation {
      */
     RemoveRemoteEncryptedFileOperation(String remotePath,
                                        String parentId,
-                                       Account account,
+                                       User user,
                                        Context context,
                                        String fileName) {
         this.remotePath = remotePath;
         this.parentId = parentId;
-        this.account = account;
+        this.user = user;
         this.fileName = fileName;
 
         arbitraryDataProvider = new ArbitraryDataProvider(context.getContentResolver());
@@ -97,7 +97,7 @@ public class RemoveRemoteEncryptedFileOperation extends RemoteOperation {
         String token = null;
         DecryptedFolderMetadata metadata;
 
-        String privateKey = arbitraryDataProvider.getValue(account.name, EncryptionUtils.PRIVATE_KEY);
+        String privateKey = arbitraryDataProvider.getValue(user.getAccountName(), EncryptionUtils.PRIVATE_KEY);
 
         try {
             // Lock folder

+ 2 - 2
app/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java

@@ -284,7 +284,7 @@ public class DocumentsStorageProvider extends DocumentsProvider {
         Context context = getNonNullContext();
         OCFile ocFile = document.getFile();
         RemoteOperationResult result = new CheckEtagRemoteOperation(ocFile.getRemotePath(), ocFile.getEtag())
-            .execute(document.getUser().toPlatformAccount(), context);
+            .execute(document.getUser(), context);
         switch (result.getCode()) {
             case ETAG_CHANGED:
                 return true;
@@ -611,7 +611,7 @@ public class DocumentsStorageProvider extends DocumentsProvider {
         OCFile file = document.getStorageManager().getFileByPath(document.getRemotePath());
         RemoteOperationResult result = new RemoveFileOperation(file,
                                                                false,
-                                                               document.getUser().toPlatformAccount(),
+                                                               document.getUser(),
                                                                true,
                                                                context,
                                                                document.getStorageManager())

+ 1 - 1
app/src/main/java/com/owncloud/android/services/OperationsService.java

@@ -668,7 +668,7 @@ public class OperationsService extends Service {
                         boolean inBackground = operationIntent.getBooleanExtra(EXTRA_IN_BACKGROUND, false);
                         operation = new RemoveFileOperation(file,
                                                             onlyLocalCopy,
-                                                            account,
+                                                            user,
                                                             inBackground,
                                                             getApplicationContext(),
                                                             fileDataStorageManager);

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -1165,7 +1165,7 @@ public abstract class DrawerActivity extends ToolbarActivity
 
                         Log_OC.d("ExternalLinks", "update via api");
                         RemoteOperation getExternalLinksOperation = new ExternalLinksOperation();
-                        RemoteOperationResult result = getExternalLinksOperation.execute(user.toPlatformAccount(), this);
+                        RemoteOperationResult result = getExternalLinksOperation.execute(user, this);
 
                         if (result.isSuccess() && result.getData() != null) {
                             externalLinksProvider.deleteAllExternalLinks();

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/activity/RichDocumentsEditorWebView.java

@@ -176,7 +176,7 @@ public class RichDocumentsEditorWebView extends EditorWebView {
         new Thread(() -> {
             User user = currentAccountProvider.getUser();
             RichDocumentsCreateAssetOperation operation = new RichDocumentsCreateAssetOperation(file.getRemotePath());
-            RemoteOperationResult result = operation.execute(user.toPlatformAccount(), this);
+            RemoteOperationResult result = operation.execute(user, this);
 
             if (result.isSuccess()) {
                 String asset = (String) result.getSingleData();

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/activity/ShareActivity.java

@@ -108,7 +108,7 @@ public class ShareActivity extends FileActivity {
         Activity activity = this;
         new Thread(() -> {
             RemoteOperationResult result = new ReadFileRemoteOperation(getFile().getRemotePath())
-                .execute(optionalUser.get().toPlatformAccount(),
+                .execute(optionalUser.get(),
                          activity);
 
             if (result.isSuccess()) {

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java

@@ -770,7 +770,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
                                                                                             mStorageManager,
                                                                                             user,
                                                                                             activity);
-                        refreshFolderOperation.execute(user.toPlatformAccount(), activity);
+                        refreshFolderOperation.execute(user, activity);
                     }
                 }
 

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java

@@ -578,7 +578,7 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
                                    storageManager,
                                    user,
                                    context)
-            .execute(user.toPlatformAccount(), context, (caller, result) -> {
+            .execute(user, context, (caller, result) -> {
                 view.binding.uploadListItemLayout.setClickable(true);
                 listener.onRemoteOperationFinish(caller, result);
             }, parentActivity.getHandler());

+ 3 - 4
app/src/main/java/com/owncloud/android/ui/asynctasks/FetchRemoteFileTask.java

@@ -60,8 +60,7 @@ public class FetchRemoteFileTask extends AsyncTask<Void, Void, String> {
                                                                                 FILE_ID_SEARCH,
                                                                                 false,
                                                                                 fileDisplayActivity.getCapabilities());
-        RemoteOperationResult remoteOperationResult = searchRemoteOperation.execute(user.toPlatformAccount(),
-                                                                                    fileDisplayActivity);
+        RemoteOperationResult remoteOperationResult = searchRemoteOperation.execute(user, fileDisplayActivity);
 
         if (remoteOperationResult.isSuccess() && remoteOperationResult.getData() != null) {
             if (remoteOperationResult.getData().isEmpty()) {
@@ -70,7 +69,7 @@ public class FetchRemoteFileTask extends AsyncTask<Void, Void, String> {
             String remotePath = ((RemoteFile) remoteOperationResult.getData().get(0)).getRemotePath();
 
             ReadFileRemoteOperation operation = new ReadFileRemoteOperation(remotePath);
-            RemoteOperationResult result = operation.execute(user.toPlatformAccount(), fileDisplayActivity);
+            RemoteOperationResult result = operation.execute(user, fileDisplayActivity);
 
             if (!result.isSuccess()) {
                 Exception exception = result.getException();
@@ -105,7 +104,7 @@ public class FetchRemoteFileTask extends AsyncTask<Void, Void, String> {
                                                                                 storageManager,
                                                                                 user,
                                                                                 fileDisplayActivity);
-            refreshFolderOperation.execute(user.toPlatformAccount(), fileDisplayActivity);
+            refreshFolderOperation.execute(user, fileDisplayActivity);
 
             fileDisplayActivity.setFile(ocFile);
         } else {

+ 1 - 2
app/src/main/java/com/owncloud/android/ui/asynctasks/GallerySearchTask.java

@@ -96,8 +96,7 @@ public class GallerySearchTask extends AsyncTask<Void, Void, GallerySearchTask.R
                              " - " + new Date(endDate * 1000L) +
                              " with limit: " + limit);
 
-                RemoteOperationResult result = searchRemoteOperation.execute(user.toPlatformAccount(),
-                                                                             photoFragment.getContext());
+                RemoteOperationResult result = searchRemoteOperation.execute(user, photoFragment.getContext());
 
                 if (result.isSuccess()) {
                     boolean emptySearch = parseMedia(startDate, endDate, result.getData());

+ 4 - 5
app/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java

@@ -297,7 +297,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment implements Inj
             }
 
             RemoteOperationResult<com.owncloud.android.lib.ocs.responses.PrivateKey> privateKeyResult =
-                new GetPrivateKeyOperation().execute(user.toPlatformAccount(), getContext());
+                new GetPrivateKeyOperation().execute(user, getContext());
 
             if (privateKeyResult.isSuccess()) {
                 Log_OC.d(TAG, "private key successful downloaded for " + user.getAccountName());
@@ -356,7 +356,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment implements Inj
                 String urlEncoded = CsrHelper.generateCsrPemEncodedString(keyPair, userId);
 
                 SendCSROperation operation = new SendCSROperation(urlEncoded);
-                RemoteOperationResult result = operation.execute(user.toPlatformAccount(), getContext());
+                RemoteOperationResult result = operation.execute(user, getContext());
 
                 if (result.isSuccess()) {
                     Log_OC.d(TAG, "public key success");
@@ -374,8 +374,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment implements Inj
 
                 // upload encryptedPrivateKey
                 StorePrivateKeyOperation storePrivateKeyOperation = new StorePrivateKeyOperation(encryptedPrivateKey);
-                RemoteOperationResult storePrivateKeyResult = storePrivateKeyOperation.execute(user.toPlatformAccount(),
-                                                                                               getContext());
+                RemoteOperationResult storePrivateKeyResult = storePrivateKeyOperation.execute(user, getContext());
 
                 if (storePrivateKeyResult.isSuccess()) {
                     Log_OC.d(TAG, "private key success");
@@ -390,7 +389,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment implements Inj
                     return (String) storePrivateKeyResult.getData().get(0);
                 } else {
                     DeletePublicKeyOperation deletePublicKeyOperation = new DeletePublicKeyOperation();
-                    deletePublicKeyOperation.execute(user.toPlatformAccount(), getContext());
+                    deletePublicKeyOperation.execute(user, getContext());
                 }
             } catch (Exception e) {
                 Log_OC.e(TAG, e.getMessage());

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -542,7 +542,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
     public void createRichWorkspace() {
         new Thread(() -> {
             RemoteOperationResult result = new RichWorkspaceDirectEditingRemoteOperation(mFile.getRemotePath())
-                .execute(accountManager.getUser().toPlatformAccount(), requireContext());
+                .execute(accountManager.getUser(), requireContext());
 
             if (result.isSuccess()) {
                 String url = (String) result.getSingleData();

+ 1 - 3
app/src/main/java/com/owncloud/android/ui/fragment/OCFileListSearchAsyncTask.kt

@@ -61,9 +61,7 @@ class OCFileListSearchAsyncTask(
         }
 
         fragment.setTitle()
-        val remoteOperationResult = remoteOperation.execute(
-            currentUser.toPlatformAccount(), fragment.context
-        )
+        val remoteOperationResult = remoteOperation.execute(currentUser, fragment.context)
         if (remoteOperationResult.hasSuccessfulResult() && !isCancelled && fragment.searchFragment) {
             fragment.searchEvent = event
             if (remoteOperationResult.resultData.isNullOrEmpty()) {

+ 1 - 2
app/src/main/java/com/owncloud/android/ui/fragment/SharedListFragment.kt

@@ -84,8 +84,7 @@ class SharedListFragment : OCFileListFragment(), Injectable {
     private suspend fun fetchFileData(partialFile: OCFile): OCFile? {
         return withContext(Dispatchers.IO) {
             val user = accountManager.user
-            val fetchResult = ReadFileRemoteOperation(partialFile.remotePath)
-                .execute(user.toPlatformAccount(), context)
+            val fetchResult = ReadFileRemoteOperation(partialFile.remotePath).execute(user, context)
             if (!fetchResult.isSuccess) {
                 logger.e(SHARED_TAG, "Error fetching file")
                 if (fetchResult.isException) {

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/fragment/contactsbackup/BackupFragment.java

@@ -260,7 +260,7 @@ public class BackupFragment extends FileFragment implements DatePickerDialog.OnD
                     RefreshFolderOperation operation = new RefreshFolderOperation(folder, System.currentTimeMillis(),
                             false, false, storageManager, user, context);
 
-                    RemoteOperationResult result = operation.execute(user.toPlatformAccount(), context);
+                    RemoteOperationResult result = operation.execute(user, context);
                     return result.isSuccess();
                 } else {
                     return Boolean.FALSE;

+ 2 - 2
app/src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java

@@ -235,7 +235,7 @@ public class FileOperationsHelper {
             // check for changed eTag
             CheckEtagRemoteOperation checkEtagOperation = new CheckEtagRemoteOperation(file.getRemotePath(),
                                                                                        file.getEtag());
-            RemoteOperationResult result = checkEtagOperation.execute(user.toPlatformAccount(), fileActivity);
+            RemoteOperationResult result = checkEtagOperation.execute(user, fileActivity);
 
             // eTag changed, sync file
             if (result.getCode() == RemoteOperationResult.ResultCode.ETAG_CHANGED) {
@@ -454,7 +454,7 @@ public class FileOperationsHelper {
         final User user = currentAccount.getUser();
         new Thread(() -> {
             StreamMediaFileOperation sfo = new StreamMediaFileOperation(file.getRemoteId());
-            RemoteOperationResult result = sfo.execute(user.toPlatformAccount(), fileActivity);
+            RemoteOperationResult result = sfo.execute(user, fileActivity);
 
             fileActivity.dismissLoadingDialog();
 

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/preview/PreviewTextStringFragment.java

@@ -136,7 +136,7 @@ public class PreviewTextStringFragment extends PreviewTextFragment {
     private void edit() {
         new Thread(() -> {
             RemoteOperationResult result = new RichWorkspaceDirectEditingRemoteOperation(getFile().getRemotePath())
-                .execute(accountManager.getUser().toPlatformAccount(), getContext());
+                .execute(accountManager.getUser(), getContext());
 
             if (result.isSuccess()) {
                 String url = (String) result.getSingleData();