mirror of
https://github.com/nextcloud/android.git
synced 2024-12-18 15:01:57 +03:00
fix code analytics
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
f1cbb590eb
commit
b39269d926
5 changed files with 8 additions and 13 deletions
|
@ -172,5 +172,5 @@ interface BackgroundJobManager {
|
|||
fun startPeriodicallyOfflineOperation()
|
||||
fun scheduleInternal2WaySync(intervalMinutes: Long)
|
||||
fun cancelAllFilesDownloadJobs()
|
||||
fun syncFolder(filePaths: List<String>)
|
||||
fun syncFolder(files: List<OCFile>)
|
||||
}
|
||||
|
|
|
@ -715,7 +715,9 @@ internal class BackgroundJobManagerImpl(
|
|||
workManager.enqueueUniquePeriodicWork(JOB_INTERNAL_TWO_WAY_SYNC, ExistingPeriodicWorkPolicy.UPDATE, request)
|
||||
}
|
||||
|
||||
override fun syncFolder(filePaths: List<String>) {
|
||||
override fun syncFolder(files: List<OCFile>) {
|
||||
val filePaths = files.map { it.decryptedRemotePath }
|
||||
|
||||
val data = Data.Builder()
|
||||
.putStringArray(SyncWorker.FILE_PATHS, filePaths.toTypedArray())
|
||||
.build()
|
||||
|
|
|
@ -138,7 +138,7 @@ class FileDownloadHelper {
|
|||
)
|
||||
}
|
||||
|
||||
fun syncFolder(filePaths: List<String>) {
|
||||
backgroundJobManager.syncFolder(filePaths)
|
||||
fun syncFolder(files: List<OCFile>) {
|
||||
backgroundJobManager.syncFolder(files)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ class SyncWorker(
|
|||
val filePaths = inputData.getStringArray(FILE_PATHS)
|
||||
|
||||
if (filePaths.isNullOrEmpty()) {
|
||||
return@withContext Result.failure()
|
||||
return@withContext Result.success()
|
||||
}
|
||||
|
||||
val fileDataStorageManager = FileDataStorageManager(user, context.contentResolver)
|
||||
|
|
|
@ -40,7 +40,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
|
||||
|
@ -501,13 +500,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
|
|||
Log_OC.d(TAG, "Exception caught at startDirectDownloads" + e);
|
||||
}
|
||||
} else {
|
||||
final var filePaths = new ArrayList<String>();
|
||||
mFilesForDirectDownload.forEach(file -> filePaths.add(file.getDecryptedRemotePath()));
|
||||
if (filePaths.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
fileDownloadHelper.syncFolder(filePaths);
|
||||
fileDownloadHelper.syncFolder(mFilesForDirectDownload);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue