Skip to content

Commit 2e11a97

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

2 files changed

Lines changed: 9 additions & 25 deletions

File tree

app/src/main/java/com/nextcloud/client/jobs/folderDownload/FolderDownloadWorkerNotificationManager.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ class FolderDownloadWorkerNotificationManager(
4747
clearActions()
4848
setContentText(description)
4949

50-
if (progress != null && showCancel) {
50+
if (progress != null) {
5151
setProgress(MAX_PROGRESS, progress, false)
52-
addAction(
53-
R.drawable.ic_cancel,
54-
context.getString(R.string.common_cancel),
55-
getCancelPendingIntent()
56-
)
52+
if (showCancel) {
53+
addAction(
54+
R.drawable.ic_cancel,
55+
context.getString(R.string.common_cancel),
56+
getCancelPendingIntent()
57+
)
58+
}
5759
} else {
5860
setProgress(0, 0, false)
5961
}

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -557,27 +557,9 @@ private void startContentSynchronizations(List<SynchronizeFileOperation> filesTo
557557
}
558558
}
559559

560-
// FIXME: NOT DISPLAYING
561560
notificationManager.showCompletionNotification(folderName, success);
562561
}
563562

564-
/**
565-
* Scans the default location for saving local copies of files searching for
566-
* a 'lost' file with the same full name as the {@link com.owncloud.android.datamodel.OCFile}
567-
* received as parameter.
568-
*
569-
* @param file File to associate a possible 'lost' local file.
570-
*/
571-
private void searchForLocalFileInDefaultPath(OCFile file) {
572-
if (file.getStoragePath() == null && !file.isFolder()) {
573-
File f = new File(FileStorageUtils.getDefaultSavePathFor(user.getAccountName(), file));
574-
if (f.exists()) {
575-
file.setStoragePath(f.getAbsolutePath());
576-
file.setLastSyncDateForData(f.lastModified());
577-
}
578-
}
579-
}
580-
581563

582564
/**
583565
* Cancel operation
@@ -602,7 +584,7 @@ public Optional<String> getFolderNameFromPath() {
602584
return Optional.of(folder.getName());
603585
}
604586

605-
private void startSyncFolderOperation(String path){
587+
private void startSyncFolderOperation(String path) {
606588
Intent intent = new Intent(mContext, OperationsService.class);
607589
intent.setAction(OperationsService.ACTION_SYNC_FOLDER);
608590
intent.putExtra(OperationsService.EXTRA_ACCOUNT, user.toPlatformAccount());

0 commit comments

Comments
 (0)