import android.app.NotificationManager;\r
import android.app.PendingIntent;\r
import android.app.Service;\r
+import android.content.ContentValues;\r
import android.content.Intent;\r
import android.net.Uri;\r
import android.os.Binder;\r
import android.os.Process;\r
import android.util.Log;\r
import eu.alefzero.owncloud.authenticator.AccountAuthenticator;\r
+import eu.alefzero.owncloud.db.DbHandler;\r
+import eu.alefzero.owncloud.db.ProviderMeta.ProviderTableMeta;\r
import eu.alefzero.owncloud.ui.activity.FileDisplayActivity;\r
import eu.alefzero.webdav.WebdavClient;\r
\r
Message msg = mServiceHandler.obtainMessage();\r
msg.arg1 = startId;\r
mServiceHandler.sendMessage(msg);\r
- \r
- \r
+\r
return START_NOT_STICKY;\r
}\r
\r
try {\r
password = am.blockingGetAuthToken(mAccount, AccountAuthenticator.AUTH_TOKEN_TYPE, true);\r
} catch (Exception e) {\r
- // TODO Auto-generated catch block\r
e.printStackTrace();\r
}\r
\r
File file = new File(dir, mFilePath.replace('/', '.'));\r
\r
wdc.downloadFile(mFilePath, file);\r
+ ContentValues cv = new ContentValues();\r
+ cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getAbsolutePath());\r
+ getContentResolver().update(ProviderTableMeta.CONTENT_URI,\r
+ cv,\r
+ ProviderTableMeta.FILE_NAME +"=? AND "+ProviderTableMeta.FILE_ACCOUNT_OWNER+"=?",\r
+ new String[]{mFilePath.substring(mFilePath.lastIndexOf('/')+1), mAccount.name});\r
nm.cancel(1);\r
}\r
\r