Эх сурвалжийг харах

Fix code analytics

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 жил өмнө
parent
commit
11fa95d2b9

+ 2 - 0
app/src/main/java/com/nextcloud/client/files/downloader/DownloadNotificationManager.kt

@@ -44,6 +44,7 @@ import com.owncloud.android.utils.theme.ViewThemeUtils
 import java.io.File
 import java.security.SecureRandom
 
+@Suppress("TooManyFunctions")
 class DownloadNotificationManager(private val context: Context, private val viewThemeUtils: ViewThemeUtils) {
 
     private var notification: Notification? = null
@@ -198,6 +199,7 @@ class DownloadNotificationManager(private val context: Context, private val view
         notificationManager.cancel(R.string.downloader_download_in_progress_ticker)
     }
 
+    @Suppress("MagicNumber")
     fun dismissAll() {
         Handler(Looper.getMainLooper()).postDelayed({
             notificationManager.cancelAll()

+ 10 - 10
app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt

@@ -161,6 +161,16 @@ class FileDownloadWorker(
         WorkerStateLiveData.instance().setWorkState(WorkerState.Idle)
     }
 
+    private fun cancelAllDownloads() {
+        pendingDownloads.all.forEach {
+            it.value.payload?.cancel()
+        }
+    }
+
+    private fun removePendingDownload(accountName: String?) {
+        pendingDownloads.remove(accountName)
+    }
+
     private fun notifyForFolderResult(folder: OCFile) {
         notificationManager.notifyForResult(null, null, folder, isAnyOperationFailed)
     }
@@ -212,16 +222,6 @@ class FileDownloadWorker(
         }
     }
 
-    private fun removePendingDownload(accountName: String?) {
-        pendingDownloads.remove(accountName)
-    }
-
-    private fun cancelAllDownloads() {
-        pendingDownloads.all.forEach {
-            it.value.payload?.cancel()
-        }
-    }
-
     private fun setUser() {
         val accountName = inputData.keyValueMap[USER_NAME] as String
         user = accountManager.getUser(accountName).get()