Unverified Commit 266410c6 authored by Matthew Finkel's avatar Matthew Finkel
Browse files

Merge remote-tracking branch 'acatgl/40002' into android-components-57.0.6-10.0-2

parents 288e6a1e 8c794786
......@@ -20,6 +20,8 @@ android {
arg("room.schemaLocation", "$projectDir/schemas".toString())
}
}
buildConfigField("boolean", "ANDROID_DOWNLOADS_INTEGRATION", "false")
}
buildTypes {
......
......@@ -326,7 +326,9 @@ abstract class AbstractFetchDownloadService : Service() {
PAUSED -> DownloadNotification.createPausedDownloadNotification(context, download)
FAILED -> DownloadNotification.createDownloadFailedNotification(context, download)
COMPLETED -> {
addToDownloadSystemDatabaseCompat(download.state)
if (BuildConfig.ANDROID_DOWNLOADS_INTEGRATION) {
addToDownloadSystemDatabaseCompat(download.state)
}
DownloadNotification.createDownloadCompletedNotification(context, download)
}
CANCELLED -> {
......@@ -688,7 +690,7 @@ abstract class AbstractFetchDownloadService : Service() {
val downloadWithUniqueFileName = makeUniqueFileNameIfNecessary(download, append)
updateDownloadState(downloadWithUniqueFileName)
if (getSdkVersion() >= Build.VERSION_CODES.Q && !isExternalStorageLegacy()) {
if (BuildConfig.ANDROID_DOWNLOADS_INTEGRATION && getSdkVersion() >= Build.VERSION_CODES.Q && !isExternalStorageLegacy()) {
useFileStreamScopedStorage(downloadWithUniqueFileName, block)
} else {
useFileStreamLegacy(downloadWithUniqueFileName, append, block)
......
......@@ -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
......@@ -69,7 +68,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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment