Browse Source

:Conflict files are removed from the upload storage manager after downloaded successfully.

wknds 3 years ago
parent
commit
e6b6c6ff56

+ 0 - 3
.idea/codeStyles/Project.xml

@@ -78,9 +78,6 @@
       <option name="FOR_BRACE_FORCE" value="3" />
       <option name="FIELD_ANNOTATION_WRAP" value="0" />
     </codeStyleSettings>
-    <codeStyleSettings language="Markdown">
-      <option name="RIGHT_MARGIN" value="120" />
-    </codeStyleSettings>
     <codeStyleSettings language="XML">
       <indentOptions>
         <option name="CONTINUATION_INDENT_SIZE" value="4" />

+ 3 - 4
src/main/java/com/owncloud/android/files/services/FileDownloader.java

@@ -632,6 +632,9 @@ public class FileDownloader extends Service
 
         if (!downloadResult.isCancelled()) {
             if (downloadResult.isSuccess()) {
+                if (conflictUploadId > 0) {
+                    uploadsStorageManager.removeUpload(conflictUploadId);
+                }
                 // Dont show notification except an error has occured.
                 return;
             }
@@ -667,10 +670,6 @@ public class FileDownloader extends Service
 
                 // Remove success notification
                 if (downloadResult.isSuccess()) {
-                    if (conflictUploadId > 0) {
-                        uploadsStorageManager.removeUpload(conflictUploadId);
-                    }
-
                     // Sleep 2 seconds, so show the notification before remove it
                     NotificationUtils.cancelWithDelay(mNotificationManager,
                                                       R.string.downloader_download_succeeded_ticker, 2000);