Skip to content

Commit 3aee24e

Browse files
Merge pull request #14541 from nextcloud/backport/14539/stable-3.31
[stable-3.31] BugFix - Add Missing mTransferWasRequested
2 parents f5220ed + 369c5c9 commit 3aee24e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Diff for: app/src/main/java/com/owncloud/android/operations/SynchronizeFileOperation.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -302,29 +302,29 @@ private void requestForUpload(OCFile file) {
302302

303303
private void requestForDownload(OCFile file) {
304304
final var fileDownloadHelper = FileDownloadHelper.Companion.instance();
305-
305+
final var filename = file.getFileName();
306+
306307
if (syncInBackgroundWorker) {
307-
Log_OC.d("InternalTwoWaySyncWork", "download file: " + file.getFileName());
308+
Log_OC.d(TAG, "downloading file without notification: " + filename);
308309

309310
try {
310311
final var operation = new DownloadFileOperation(mUser, file, mContext);
311-
var result = operation.execute(getClient());
312+
final var result = operation.execute(getClient());
312313

313314
mTransferWasRequested = true;
314315

315-
String filename = file.getFileName();
316-
if (filename != null) {
317-
if (result.isSuccess()) {
318-
fileDownloadHelper.saveFile(file, operation, getStorageManager());
319-
Log_OC.d(TAG, "requestForDownload completed for: " + file.getFileName());
320-
} else {
321-
Log_OC.d(TAG, "requestForDownload failed for: " + file.getFileName());
322-
}
316+
if (result.isSuccess()) {
317+
fileDownloadHelper.saveFile(file, operation, getStorageManager());
318+
Log_OC.d(TAG, "requestForDownload completed for: " + filename);
319+
} else {
320+
Log_OC.d(TAG, "requestForDownload failed for: " + filename);
323321
}
324322
} catch (Exception e) {
325323
Log_OC.d(TAG, "Exception caught at requestForDownload" + e);
326324
}
327325
} else {
326+
Log_OC.d(TAG, "downloading file with notification: " + filename);
327+
mTransferWasRequested = true;
328328
fileDownloadHelper.downloadFile(mUser, file);
329329
}
330330
}

0 commit comments

Comments
 (0)