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

This commit is contained in:
wknds 2021-09-29 22:33:34 +02:00 committed by Álvaro Brey (Rebase PR Action)
parent 60e44986a0
commit e6b6c6ff56
2 changed files with 3 additions and 7 deletions

View file

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

View file

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