X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/48872989d72ff8bc88932c39a55d22aea425ced6..aae90eb1aa42a11449e30330e3e23e1e9e5eebb6:/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 34686915..2e34a8b6 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -34,10 +34,11 @@ import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.common.network.OnDatatransferProgressListener; +import com.owncloud.android.lib.common.OwnCloudAccount; import com.owncloud.android.lib.common.OwnCloudClient; +import com.owncloud.android.lib.common.OwnCloudClientManagerFactory; import com.owncloud.android.notifications.NotificationBuilderWithProgressBar; import com.owncloud.android.notifications.NotificationDelayer; -import com.owncloud.android.lib.common.OwnCloudClientMap; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.resources.files.FileUtils; @@ -349,7 +350,9 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis mLastAccount = mCurrentDownload.getAccount(); mStorageManager = new FileDataStorageManager(mLastAccount, getContentResolver()); - mDownloadClient = OwnCloudClientMap.getClientFor(mLastAccount, this); + OwnCloudAccount ocAccount = new OwnCloudAccount(mLastAccount, this); + mDownloadClient = OwnCloudClientManagerFactory.getDefaultSingleton(). + getClientFor(ocAccount, this); } /// perform the download @@ -467,9 +470,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;