- moved MediaScan to DownloadFileOperation.
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / SynchronizeFileOperation.java
index c8ee1e2..433acf7 100644 (file)
@@ -33,6 +33,7 @@ import com.owncloud.android.utils.FileStorageUtils;
 import android.accounts.Account;
 import android.content.Context;
 import android.content.Intent;
+import android.media.MediaScannerConnection;
 
 /**
  * Remote operation performing the read of remote file in the ownCloud server.
@@ -170,6 +171,8 @@ public class SynchronizeFileOperation extends SyncOperation {
                     result = new RemoteOperationResult(ResultCode.OK);
 
                 } else if (serverChanged) {
+                    mLocalFile.setRemoteId(mServerFile.getRemoteId());
+                    
                     if (mSyncFileContents) {
                         requestForDownload(mLocalFile); // local, not server; we won't to keep the value of keepInSync!
                         // the update of local data will be done later by the FileUploader service when the upload finishes
@@ -192,7 +195,6 @@ public class SynchronizeFileOperation extends SyncOperation {
             } 
 
         }
-
         Log_OC.i(TAG, "Synchronizing " + mAccount.name + ", file " + mLocalFile.getRemotePath() + ": " + result.getLogMessage());
 
         return result;