Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 191c2c05 authored by Nishant Dande's avatar Nishant Dande
Browse files

Fix Klint issue

parent a0f32d7f
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ class DownloadManagerUtils @Inject constructor(
    @ApplicationContext private val context: Context,
    private val fusedManagerRepository: FusedManagerRepository,
    private val downloadManager: DownloadManager,
    private val storageNotificationManager: StorageNotificationManager,
    private val storageNotificationManager: StorageNotificationManager
) {
    private val mutex = Mutex()

@@ -107,7 +107,8 @@ class DownloadManagerUtils @Inject constructor(
        fusedDownload: FusedDownload,
        downloadId: Long
    ) = downloadManager.isDownloadSuccessful(downloadId) && areAllFilesDownloaded(
        numberOfDownloadedItems, fusedDownload
        numberOfDownloadedItems,
        fusedDownload
    ) && checkCleanApkSignatureOK(fusedDownload)

    private fun areAllFilesDownloaded(
@@ -126,7 +127,8 @@ class DownloadManagerUtils @Inject constructor(

    private suspend fun checkCleanApkSignatureOK(fusedDownload: FusedDownload): Boolean {
        if (fusedDownload.origin != Origin.CLEANAPK || fusedManagerRepository.isFdroidApplicationSigned(
                context, fusedDownload
                context,
                fusedDownload
            )
        ) {
            Timber.d("Apk signature is OK")
+1 −2
Original line number Diff line number Diff line
@@ -35,14 +35,13 @@ import javax.inject.Inject

class StorageNotificationManager @Inject constructor(
    @ApplicationContext private val context: Context,
    private val downloadManager: DownloadManager,
    private val downloadManager: DownloadManager
) {
    companion object {
        const val NOT_ENOUGH_SPACE_NOTIFICATION_ID = 7874
    }

    fun showNotEnoughSpaceNotification(fusedDownload: FusedDownload, downloadId: Long? = null) {

        with(NotificationManagerCompat.from(context)) {
            if (ActivityCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS)
                != PackageManager.PERMISSION_GRANTED
+8 −4
Original line number Diff line number Diff line
@@ -164,7 +164,8 @@ class AppInstallProcessor @Inject constructor(
            EventBus.invokeEvent(
                AppEvent.UpdateEvent(
                    ResultSupreme.WorkError(
                        ResultStatus.UNKNOWN, fusedDownload
                        ResultStatus.UNKNOWN,
                        fusedDownload
                    )
                )
            )
@@ -177,7 +178,8 @@ class AppInstallProcessor @Inject constructor(
        fusedDownload: FusedDownload
    ) {
        fusedAPIRepository.updateFusedDownloadWithDownloadingInfo(
            fusedDownload.origin, fusedDownload
            fusedDownload.origin,
            fusedDownload
        )
    }

@@ -257,7 +259,8 @@ class AppInstallProcessor @Inject constructor(
    private suspend fun isUpdateCompleted(): Boolean {
        val downloadListWithoutAnyIssue = fusedDownloadRepository.getDownloadList().filter {
            !listOf(
                Status.INSTALLATION_ISSUE, Status.PURCHASE_NEEDED
                Status.INSTALLATION_ISSUE,
                Status.PURCHASE_NEEDED
            ).contains(it.status)
        }

@@ -353,7 +356,8 @@ class AppInstallProcessor @Inject constructor(

            else -> {
                Timber.wtf(
                    TAG, "===> ${fusedDownload.name} is in wrong state ${fusedDownload.status}"
                    TAG,
                    "===> ${fusedDownload.name} is in wrong state ${fusedDownload.status}"
                )
                finishInstallation(fusedDownload)
            }