Skip to content

Commit b222500

Browse files
committed
feat(sync-all): show notifications
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 2e11a97 commit b222500

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ public class SynchronizeFolderOperation extends SyncOperation {
9393

9494
final FolderDownloadWorkerNotificationManager notificationManager;
9595

96+
private boolean hasChildFolders = false;
97+
9698
/**
9799
* Creates a new instance of {@link SynchronizeFolderOperation}.
98100
*
@@ -397,6 +399,7 @@ private void updateLocalStateData(OCFile remoteFile, OCFile localFile, OCFile up
397399
@SuppressFBWarnings("JLM")
398400
private void syncFileOrFolder(OCFile remoteFile, OCFile localFile) throws OperationCancelledException {
399401
if (remoteFile.isFolder()) {
402+
hasChildFolders = true;
400403
synchronized (mCancellationRequested) {
401404
if (mCancellationRequested.get()) {
402405
throw new OperationCancelledException();
@@ -557,7 +560,10 @@ private void startContentSynchronizations(List<SynchronizeFileOperation> filesTo
557560
}
558561
}
559562

560-
notificationManager.showCompletionNotification(folderName, success);
563+
if (!hasChildFolders) {
564+
notificationManager.showCompletionNotification(folderName, success);
565+
notificationManager.dismiss();
566+
}
561567
}
562568

563569

0 commit comments

Comments
 (0)