Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
android-components
Commits
66f9f110
Verified
Commit
66f9f110
authored
Sep 29, 2020
by
Alex Catarineu
Committed by
aguestuser
Feb 02, 2022
Browse files
Bug 40002: Ensure system download manager is not used
parent
2487f9ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
components/feature/downloads/build.gradle
View file @
66f9f110
...
...
@@ -21,6 +21,8 @@ android {
arg
(
"room.schemaLocation"
,
"$projectDir/schemas"
.
toString
())
}
}
buildConfigField
(
"boolean"
,
"ANDROID_DOWNLOADS_INTEGRATION"
,
"false"
)
}
buildTypes
{
...
...
components/feature/downloads/src/main/java/mozilla/components/feature/downloads/AbstractFetchDownloadService.kt
View file @
66f9f110
...
...
@@ -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
,
...
...
@@ -839,7 +841,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.
...
...
components/feature/downloads/src/main/java/mozilla/components/feature/downloads/DownloadsFeature.kt
View file @
66f9f110
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment