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

Commit 1c7f4d25 authored by Hasib Prince's avatar Hasib Prince
Browse files

Merge branch '1459-sentry_message' into 'main'

1459 sentry message

See merge request !353
parents 2ca13f69 703b871b
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ dependencies {
    // TODO: Add splitinstall-lib to a repo https://gitlab.e.foundation/e/os/backlog/-/issues/628
    api files('libs/splitinstall-lib.jar')

    implementation 'foundation.e.lib:telemetry:0.0.9-alpha'
    implementation 'foundation.e.lib:telemetry:0.0.11-alpha'
    implementation 'foundation.e:gplayapi:3.0.1-2'
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
+26 −3
Original line number Diff line number Diff line
@@ -167,19 +167,42 @@ class DownloadManager @Inject constructor(
    }

    private fun getDownloadStatus(downloadId: Long): Int {
        var status = -1
        var reason = -1
        try {
            downloadManager.query(downloadManagerQuery.setFilterById(downloadId))
                .use { cursor ->
                    if (cursor.moveToFirst()) {
                        val status =
                        status =
                            cursor.getInt(cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_STATUS))
                        reason =
                            cursor.getInt(cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_REASON))
                        Timber.d("Download Status: downloadId: $downloadId $status")
                    }
                }
        } catch (e: Exception) {
            Timber.e(e)
        }

        if (status != DownloadManager.STATUS_SUCCESSFUL) {
            Timber.e("Download Issue: $downloadId status: $status reason: $reason")
        }
        return status
    }

    fun getDownloadFailureReason(downloadId: Long): Int {
        var reason = -1
        try {
            downloadManager.query(downloadManagerQuery.setFilterById(downloadId))
                .use { cursor ->
                    if (cursor.moveToFirst()) {
                        reason =
                            cursor.getInt(cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_REASON))
                    }
                }
        } catch (e: Exception) {
            Timber.e(e)
        }
        return DownloadManager.STATUS_FAILED
        return reason
    }
}
+1 −3
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ package foundation.e.apps.data.blockedApps
import com.google.gson.Gson
import foundation.e.apps.data.DownloadManager
import foundation.e.apps.data.fusedDownload.FileManager
import foundation.e.lib.telemetry.Telemetry
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import timber.log.Timber
@@ -71,8 +70,7 @@ class BlockedAppRepository @Inject constructor(
                Timber.i("Blocked list file contents: $blockedAppInfoJson")
                gson.fromJson(blockedAppInfoJson, AppWarningInfo::class.java)
            } catch (exception: Exception) {
                exception.printStackTrace()
                Telemetry.reportException(exception)
                Timber.e(exception.localizedMessage ?: "", exception)
                AppWarningInfo(listOf())
            }
        }
+5 −1
Original line number Diff line number Diff line
@@ -65,6 +65,10 @@ class DownloadManagerUtils @Inject constructor(

                    if (downloadManager.hasDownloadFailed(downloadId)) {
                        handleDownloadFailed(fusedDownload)
                        Timber.e(
                            "Download failed for ${fusedDownload.packageName}, " +
                                "reason: ${downloadManager.getDownloadFailureReason(downloadId)}"
                        )
                        return@launch
                    }

@@ -86,7 +90,7 @@ class DownloadManagerUtils @Inject constructor(
    private suspend fun handleDownloadFailed(fusedDownload: FusedDownload) {
        fusedManagerRepository.installationIssue(fusedDownload)
        fusedManagerRepository.cancelDownload(fusedDownload)
        Timber.i("===> Download failed: ${fusedDownload.name} ${fusedDownload.status}")
        Timber.w("===> Download failed: ${fusedDownload.name} ${fusedDownload.status}")
    }

    private suspend fun validateDownload(
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ class InstallerService : Service() {
            return
        }

        Timber.e("App install is failed for: $packageName status: $status extra: $extra")
        updateInstallationIssue(packageName ?: "")
        if (status == PackageInstaller.STATUS_FAILURE_CONFLICT && extra?.contains(
                INSTALL_FAILED_UPDATE_INCOMPATIBLE
Loading