Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

package org.mozilla.reference.browser.downloads

import android.os.Environment
import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.feature.downloads.AbstractFetchDownloadService
import mozilla.components.feature.downloads.DefaultPackageNameProvider
import mozilla.components.feature.downloads.DownloadEstimator
import mozilla.components.feature.downloads.FileSizeFormatter
import mozilla.components.feature.downloads.PackageNameProvider
import mozilla.components.support.base.android.NotificationsDelegate
import mozilla.components.support.utils.DefaultDownloadFileUtils
import mozilla.components.support.utils.DownloadFileUtils
import org.mozilla.reference.browser.ext.components

class DownloadService : AbstractFetchDownloadService() {
Expand All @@ -19,5 +22,13 @@ class DownloadService : AbstractFetchDownloadService() {
override val notificationsDelegate: NotificationsDelegate by lazy { components.notificationsDelegate }
override val fileSizeFormatter: FileSizeFormatter by lazy { components.fileSizeFormatter }
override val downloadEstimator: DownloadEstimator by lazy { components.downloadEstimator }
override val downloadFileUtils: DownloadFileUtils by lazy {
DefaultDownloadFileUtils(
context = applicationContext,
downloadLocation = {
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).path
},
)
}
override val packageNameProvider: PackageNameProvider by lazy { DefaultPackageNameProvider(applicationContext) }
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
# Android Components
android-components = "149.0.20260203092803"
android-components = "149.0.20260210213212"

# AGP
android-gradle-plugin = "9.0.0"
Expand Down