X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/7d93f30346a549e2739269b7252d5f8f956a9eb3..df4b83cb75915caaf7ad49848ebb6d340045478b:/src/eu/alefzero/owncloud/FileDownloader.java diff --git a/src/eu/alefzero/owncloud/FileDownloader.java b/src/eu/alefzero/owncloud/FileDownloader.java index 87e8d966..bdcec721 100644 --- a/src/eu/alefzero/owncloud/FileDownloader.java +++ b/src/eu/alefzero/owncloud/FileDownloader.java @@ -8,9 +8,9 @@ import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; +import android.content.ContentValues; import android.content.Intent; import android.net.Uri; -import android.os.Binder; import android.os.Environment; import android.os.Handler; import android.os.HandlerThread; @@ -20,6 +20,7 @@ import android.os.Message; import android.os.Process; import android.util.Log; import eu.alefzero.owncloud.authenticator.AccountAuthenticator; +import eu.alefzero.owncloud.db.ProviderMeta.ProviderTableMeta; import eu.alefzero.owncloud.ui.activity.FileDisplayActivity; import eu.alefzero.webdav.WebdavClient; @@ -71,8 +72,7 @@ public class FileDownloader extends Service { Message msg = mServiceHandler.obtainMessage(); msg.arg1 = startId; mServiceHandler.sendMessage(msg); - - + return START_NOT_STICKY; } @@ -87,7 +87,6 @@ public class FileDownloader extends Service { try { password = am.blockingGetAuthToken(mAccount, AccountAuthenticator.AUTH_TOKEN_TYPE, true); } catch (Exception e) { - // TODO Auto-generated catch block e.printStackTrace(); } @@ -105,6 +104,12 @@ public class FileDownloader extends Service { File file = new File(dir, mFilePath.replace('/', '.')); wdc.downloadFile(mFilePath, file); + ContentValues cv = new ContentValues(); + cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getAbsolutePath()); + getContentResolver().update(ProviderTableMeta.CONTENT_URI, + cv, + ProviderTableMeta.FILE_NAME +"=? AND "+ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?", + new String[]{mFilePath.substring(mFilePath.lastIndexOf('/')+1), mAccount.name}); nm.cancel(1); }