[tx-robot] updated from transifex
[pub/Android/ownCloud.git] / src / com / owncloud / android / files / services / FileDownloader.java
index 16d9d5c..513a639 100644 (file)
@@ -174,10 +174,11 @@ public class FileDownloader extends Service
                 Pair<String, String> putResult = mPendingDownloads.putIfAbsent(
                         account, file.getRemotePath(), newDownload
                 );
                 Pair<String, String> putResult = mPendingDownloads.putIfAbsent(
                         account, file.getRemotePath(), newDownload
                 );
-                String downloadKey = putResult.first;
-                requestedDownloads.add(downloadKey);
-
-                sendBroadcastNewDownload(newDownload, putResult.second);
+                if (putResult != null) {
+                    String downloadKey = putResult.first;
+                    requestedDownloads.add(downloadKey);
+                    sendBroadcastNewDownload(newDownload, putResult.second);
+                }   // else, file already in the queue of downloads; don't repeat the request
 
             } catch (IllegalArgumentException e) {
                 Log_OC.e(TAG, "Not enough information provided in intent: " + e.getMessage());
 
             } catch (IllegalArgumentException e) {
                 Log_OC.e(TAG, "Not enough information provided in intent: " + e.getMessage());
@@ -471,7 +472,7 @@ public class FileDownloader extends Service
         file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
         mStorageManager.saveFile(file);
         mStorageManager.triggerMediaScan(file.getStoragePath());
         file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
         mStorageManager.saveFile(file);
         mStorageManager.triggerMediaScan(file.getStoragePath());
-        mStorageManager.saveConflict(file, false);
+        mStorageManager.saveConflict(file, null);
     }
 
     /**
     }
 
     /**