Skip to content
Snippets Groups Projects
Unverified Commit 51bf7362 authored by Alex Catarineu's avatar Alex Catarineu Committed by Matthew Finkel
Browse files

Bug 40002: Ensure system download manager is not used

parent 4225880d
No related branches found
No related tags found
1 merge request!71Bug 40007: Port external helper app prompting
......@@ -21,6 +21,8 @@ android {
arg("room.schemaLocation", "$projectDir/schemas".toString())
}
}
buildConfigField("boolean", "ANDROID_DOWNLOADS_INTEGRATION", "false")
}
buildTypes {
......
......@@ -371,7 +371,9 @@ abstract class AbstractFetchDownloadService : Service() {
style.notificationAccentColor
)
COMPLETED -> {
addToDownloadSystemDatabaseCompat(download.state, scope)
if (BuildConfig.ANDROID_DOWNLOADS_INTEGRATION) {
addToDownloadSystemDatabaseCompat(download.state, scope)
}
DownloadNotification.createDownloadCompletedNotification(
context,
download,
......@@ -836,7 +838,9 @@ abstract class AbstractFetchDownloadService : Service() {
}
@VisibleForTesting
internal fun shouldUseScopedStorage() = getSdkVersion() >= Build.VERSION_CODES.Q
internal fun shouldUseScopedStorage() =
BuildConfig.ANDROID_DOWNLOADS_INTEGRATION &&
getSdkVersion() >= Build.VERSION_CODES.Q
/**
* Gets the SDK version from the system.
......
......@@ -25,7 +25,6 @@ import mozilla.components.browser.state.state.SessionState
import mozilla.components.browser.state.state.content.DownloadState
import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.feature.downloads.DownloadDialogFragment.Companion.FRAGMENT_TAG
import mozilla.components.feature.downloads.manager.AndroidDownloadManager
import mozilla.components.feature.downloads.manager.DownloadManager
import mozilla.components.feature.downloads.manager.noop
import mozilla.components.feature.downloads.manager.onDownloadStopped
......@@ -70,7 +69,7 @@ class DownloadsFeature(
internal val useCases: DownloadsUseCases,
override var onNeedToRequestPermissions: OnNeedToRequestPermissions = { },
onDownloadStopped: onDownloadStopped = noop,
private val downloadManager: DownloadManager = AndroidDownloadManager(applicationContext, store),
private val downloadManager: DownloadManager,
private val tabId: String? = null,
private val fragmentManager: FragmentManager? = null,
private val promptsStyling: PromptsStyling? = null,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment