X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/1e7e893321e3939bf773349d41efc18caad7ab99..10b980cacf9c88dbd51b05b602cfeccccb09d1cb:/src/com/owncloud/android/operations/SynchronizeFileOperation.java?ds=sidebyside diff --git a/src/com/owncloud/android/operations/SynchronizeFileOperation.java b/src/com/owncloud/android/operations/SynchronizeFileOperation.java index c8ee1e2c..6bc3321e 100644 --- a/src/com/owncloud/android/operations/SynchronizeFileOperation.java +++ b/src/com/owncloud/android/operations/SynchronizeFileOperation.java @@ -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,6 +195,12 @@ public class SynchronizeFileOperation extends SyncOperation { } } + + // trigger MediaScan + MediaScannerConnection.scanFile( + null, + new String[]{mLocalFile.getStoragePath()}, + null,null); Log_OC.i(TAG, "Synchronizing " + mAccount.name + ", file " + mLocalFile.getRemotePath() + ": " + result.getLogMessage());