X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/5f41bb14d370e0c9c0a8003e4ed122f466b0ce71..080a8ab7af2bc48e3c5fa1334ae91d21073e26c2:/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 797053d6..b6f21a5c 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -21,14 +21,12 @@ package com.owncloud.android.files.services; import java.io.File; -import java.io.IOException; import java.util.AbstractList; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Vector; -import com.owncloud.android.MainApp; import com.owncloud.android.R; import com.owncloud.android.authentication.AccountUtils; import com.owncloud.android.authentication.AuthenticatorActivity; @@ -54,7 +52,6 @@ import com.owncloud.android.utils.ErrorMessageAdapter; import android.accounts.Account; import android.accounts.AccountManager; -import android.accounts.AccountsException; import android.accounts.OnAccountsUpdateListener; import android.app.NotificationManager; import android.app.PendingIntent; @@ -180,16 +177,6 @@ public class FileDownloader extends Service String downloadKey = putResult.first; requestedDownloads.add(downloadKey); - // Store file on db with state 'downloading' - /* - TODO - check if helps with UI responsiveness, - letting only folders use FileDownloaderBinder to check - FileDataStorageManager storageManager = - new FileDataStorageManager(account, getContentResolver()); - file.setDownloading(true); - storageManager.saveFile(file); - */ - sendBroadcastNewDownload(newDownload, putResult.second); } catch (IllegalArgumentException e) { @@ -466,6 +453,8 @@ public class FileDownloader extends Service /** * Updates the OC File after a successful download. + * + * TODO move to DownloadFileOperation */ private void saveDownloadedFile() { OCFile file = mStorageManager.getFileById(mCurrentDownload.getFile().getFileId()); @@ -482,19 +471,10 @@ public class FileDownloader extends Service file.setRemoteId(mCurrentDownload.getFile().getRemoteId()); mStorageManager.saveFile(file); mStorageManager.triggerMediaScan(file.getStoragePath()); + mStorageManager.saveConflict(file, null); } /** - * Update the OC File after a unsuccessful download - */ - private void updateUnsuccessfulDownloadedFile() { - OCFile file = mStorageManager.getFileById(mCurrentDownload.getFile().getFileId()); - file.setDownloading(false); - mStorageManager.saveFile(file); - } - - - /** * Creates a status notification to show the download progress * * @param download Download operation starting.