Verified Commit d6444a09 authored by aguestuser's avatar aguestuser
Browse files

Bug 40075: Support scoped storage to enable downloads on API < 29

- in !7,  we blocked all usage of Scoped
  Storage in an attempt to block usage of Android's
  DownloadManager, which is known to cause proxy bypasses
- as of Android API 29, downloads will not work without Scoped Storage,
  causing all downlaods to fail (see: fenix##40192)
- here, we enable usage of scoped storage for API >= 29, but block
  calls to DownloadManager on API < 29
parent 992d53f7
......@@ -371,6 +371,7 @@ abstract class AbstractFetchDownloadService : Service() {
style.notificationAccentColor
)
COMPLETED -> {
// TBA blocks this call b/c it exposes file to Android DownloadManager in API < 29
if (BuildConfig.ANDROID_DOWNLOADS_INTEGRATION) {
addToDownloadSystemDatabaseCompat(download.state, scope)
}
......@@ -841,9 +842,7 @@ abstract class AbstractFetchDownloadService : Service() {
}
@VisibleForTesting
internal fun shouldUseScopedStorage() =
BuildConfig.ANDROID_DOWNLOADS_INTEGRATION &&
getSdkVersion() >= Build.VERSION_CODES.Q
internal fun shouldUseScopedStorage() = getSdkVersion() >= Build.VERSION_CODES.Q
/**
* Gets the SDK version from the system.
......
Supports Markdown
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