Merge branch 'download_folder__refactoring_observance_of_downloads_in_progress' into...
[pub/Android/ownCloud.git] / src / com / owncloud / android / files / services / FileDownloader.java
index 3bf6dd4..741e30a 100644 (file)
@@ -169,6 +169,12 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
                     newDownload.addDatatransferProgressListener(this);
                     newDownload.addDatatransferProgressListener((FileDownloaderBinder) mBinder);
                     requestedDownloads.add(downloadKey);
+
+                    // Store file on db with state 'downloading'
+                    FileDataStorageManager storageManager = new FileDataStorageManager(account, getContentResolver());
+                    file.setDownloading(true);
+                    storageManager.saveFile(file);
+
                     sendBroadcastNewDownload(newDownload);
 
                 } catch (IllegalArgumentException e) {
@@ -253,6 +259,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
          * @param account       Owncloud account where the remote file is stored.
          * @param file          A file that could be in the queue of downloads.
          */
+        /*
         public boolean isDownloading(Account account, OCFile file) {
             if (account == null || file == null) return false;
             String targetKey = buildRemoteName(account, file);
@@ -270,6 +277,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
                 }
             }
         }
+        */
 
         
         /**