X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/8b3c9f14dc08d799996da01f18ca369643a3c61d..766b51f497971141da27ed16a11413d1bf590529:/src/com/owncloud/android/files/services/FileDownloader.java diff --git a/src/com/owncloud/android/files/services/FileDownloader.java b/src/com/owncloud/android/files/services/FileDownloader.java index 2e60636b..fdc35f8d 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -28,7 +28,6 @@ import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import com.owncloud.android.MainApp; import com.owncloud.android.R; import com.owncloud.android.authentication.AuthenticatorActivity; import com.owncloud.android.datamodel.FileDataStorageManager; @@ -42,6 +41,7 @@ import com.owncloud.android.notifications.NotificationBuilderWithProgressBar; import com.owncloud.android.notifications.NotificationDelayer; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; +import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.files.FileUtils; import com.owncloud.android.operations.DownloadFileOperation; import com.owncloud.android.ui.activity.FileActivity; @@ -49,7 +49,6 @@ import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.ui.preview.PreviewImageActivity; import com.owncloud.android.ui.preview.PreviewImageFragment; import com.owncloud.android.utils.ErrorMessageAdapter; -import com.owncloud.android.utils.Log_OC; import android.accounts.Account; import android.accounts.AccountsException; @@ -392,12 +391,14 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis long syncDate = System.currentTimeMillis(); file.setLastSyncDateForProperties(syncDate); file.setLastSyncDateForData(syncDate); + file.setNeedsUpdateThumbnail(true); file.setModificationTimestamp(mCurrentDownload.getModificationTimestamp()); file.setModificationTimestampAtLastSyncForData(mCurrentDownload.getModificationTimestamp()); // file.setEtag(mCurrentDownload.getEtag()); // TODO Etag, where available file.setMimetype(mCurrentDownload.getMimeType()); file.setStoragePath(mCurrentDownload.getSavePath()); file.setFileLength((new File(mCurrentDownload.getSavePath()).length())); + file.setRemoteId(mCurrentDownload.getFile().getRemoteId()); mStorageManager.saveFile(file); } @@ -471,9 +472,10 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis int tickerId = (downloadResult.isSuccess()) ? R.string.downloader_download_succeeded_ticker : R.string.downloader_download_failed_ticker; - boolean needsToUpdateCredentials = (downloadResult.getCode() == ResultCode.UNAUTHORIZED || - (downloadResult.isIdPRedirection() - && mDownloadClient.getCredentials() == null)); + boolean needsToUpdateCredentials = ( + downloadResult.getCode() == ResultCode.UNAUTHORIZED || + downloadResult.isIdPRedirection() + ); tickerId = (needsToUpdateCredentials) ? R.string.downloader_download_failed_credentials_error : tickerId;