Skip to content

Commit

Permalink
Fixed remaining detekt and lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MohitMaliDeveloper authored and MohitMaliFtechiz committed Jul 29, 2024
1 parent 6a5c4a7 commit f833aed
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/detekt_baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ID>EmptyFunctionBlock:None.kt$None${ }</ID>
<ID>EmptyFunctionBlock:SimplePageChangeListener.kt$SimplePageChangeListener${ }</ID>
<ID>LongParameterList:ZimManageViewModel.kt$ZimManageViewModel$( booksOnFileSystem: List&lt;BookOnDisk>, activeDownloads: List&lt;DownloadModel>, allLanguages: List&lt;Language>, libraryNetworkEntity: LibraryNetworkEntity, filter: String, fileSystemState: FileSystemState )</ID>
<ID>LongParameterList:ZimManageViewModel.kt$ZimManageViewModel$( private val downloadDao: FetchDownloadDao, private val bookDao: NewBookDao, private val languageDao: NewLanguagesDao, private val storageObserver: StorageObserver, private val kiwixService: KiwixService, private val context: Application, private val connectivityBroadcastReceiver: ConnectivityBroadcastReceiver, private val bookUtils: BookUtils, private val fat32Checker: Fat32Checker, private val defaultLanguageProvider: DefaultLanguageProvider, private val dataSource: DataSource, private val connectivityManager: ConnectivityManager, private val sharedPreferenceUtil: SharedPreferenceUtil )</ID>
<ID>LongParameterList:ZimManageViewModel.kt$ZimManageViewModel$( private val downloadDao: DownloadRoomDao, private val bookDao: NewBookDao, private val languageDao: NewLanguagesDao, private val storageObserver: StorageObserver, private val kiwixService: KiwixService, private val context: Application, private val connectivityBroadcastReceiver: ConnectivityBroadcastReceiver, private val bookUtils: BookUtils, private val fat32Checker: Fat32Checker, private val defaultLanguageProvider: DefaultLanguageProvider, private val dataSource: DataSource, private val connectivityManager: ConnectivityManager, private val sharedPreferenceUtil: SharedPreferenceUtil )</ID>
<ID>MagicNumber:LibraryListItem.kt$LibraryListItem.LibraryDownloadItem$1000L</ID>
<ID>MagicNumber:PeerGroupHandshake.kt$PeerGroupHandshake$15000</ID>
<ID>MagicNumber:ShareFiles.kt$ShareFiles$24</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ object DownloaderModule {

@Provides
@Singleton
fun providesDownloadManagerBroadcastReceiver(callback: DownloadManagerBroadcastReceiver.Callback)
: DownloadManagerBroadcastReceiver = DownloadManagerBroadcastReceiver(callback)
fun providesDownloadManagerBroadcastReceiver(
callback: DownloadManagerBroadcastReceiver.Callback
): DownloadManagerBroadcastReceiver = DownloadManagerBroadcastReceiver(callback)

@Provides
@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ import android.content.Context
import android.content.Intent
import android.database.Cursor
import android.net.Uri
import android.util.Log
import io.reactivex.Observable
import io.reactivex.schedulers.Schedulers
import io.reactivex.subjects.PublishSubject
import org.kiwix.kiwixmobile.core.dao.DownloadRoomDao
import org.kiwix.kiwixmobile.core.downloader.DownloadMonitor
import org.kiwix.kiwixmobile.core.downloader.model.DownloadModel
import org.kiwix.kiwixmobile.core.downloader.model.DownloadState
import org.kiwix.kiwixmobile.core.utils.files.Log
import java.util.concurrent.TimeUnit
import javax.inject.Inject

Expand Down Expand Up @@ -71,7 +71,7 @@ class DownloadManagerMonitor @Inject constructor(
}
}

@Suppress("MagicNumber")
@Suppress("MagicNumber", "CheckResult")
private fun startMonitoringDownloads() {
// we have to disable this when no downloads is ongoing
// and should re-enable when download started.
Expand All @@ -95,6 +95,7 @@ class DownloadManagerMonitor @Inject constructor(
)
}

@Suppress("CheckResult")
private fun setupUpdater() {
updater.subscribeOn(Schedulers.io()).observeOn(Schedulers.io()).subscribe(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ class DownloadNotificationManager @Inject constructor(
}
}

private fun shouldUpdateNotification(downloadNotificationModel: DownloadNotificationModel): Boolean =
!downloadNotificationModel.isCancelled && !downloadNotificationModel.isPaused
private fun shouldUpdateNotification(
downloadNotificationModel: DownloadNotificationModel
): Boolean = !downloadNotificationModel.isCancelled && !downloadNotificationModel.isPaused

@SuppressLint("UnspecifiedImmutableFlag")
private fun notificationCustomisation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.kiwix.kiwixmobile.core.downloader.model

import android.net.Uri
import org.kiwix.kiwixmobile.core.extensions.isFileExist
import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil
import org.kiwix.kiwixmobile.core.utils.StorageUtils
import java.io.File
Expand Down

0 comments on commit f833aed

Please sign in to comment.