[tbb-commits] [Git][tpo/applications/android-components][android-components-96.0.15-11.5-1] 3 commits: Bug 40075: Support scoped storage to enable downloads on API < 29

Matthew Finkel (@sysrqb) gitlab at torproject.org
Thu Feb 24 17:28:58 UTC 2022



Matthew Finkel pushed to branch android-components-96.0.15-11.5-1 at The Tor Project / Applications / android-components


Commits:
d6444a09 by aguestuser at 2022-02-18T13:22:07-05:00
Bug 40075: Support scoped storage to enable downloads on API < 29

- in android-components!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

- - - - -
e2daac07 by aguestuser at 2022-02-18T17:09:02-05:00
fixup! Bug 40075: Support scoped storage to enable downloads on API < 29

- abandon attempts to block writing file metadata to system db, as
justified in https://gitlab.torproject.org/tpo/applications/android-components/-/issues/40075#note_2780108
- this frees us to eliminate the `ANDROID_DOWNLOADS_INTEGRATION` feature toggle altogether

- - - - -
6ae3342f by Matthew Finkel at 2022-02-24T17:26:55+00:00
Merge remote-tracking branch 'aguestusergl/bug-40075_support-scoped-storage' into android-components-96.0.15-11.5-1

- - - - -


2 changed files:

- components/feature/downloads/build.gradle
- components/feature/downloads/src/main/java/mozilla/components/feature/downloads/AbstractFetchDownloadService.kt


Changes:

=====================================
components/feature/downloads/build.gradle
=====================================
@@ -21,8 +21,6 @@ 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
=====================================
@@ -371,9 +371,7 @@ abstract class AbstractFetchDownloadService : Service() {
                 style.notificationAccentColor
             )
             COMPLETED -> {
-                if (BuildConfig.ANDROID_DOWNLOADS_INTEGRATION) {
-                    addToDownloadSystemDatabaseCompat(download.state, scope)
-                }
+                addToDownloadSystemDatabaseCompat(download.state, scope)
                 DownloadNotification.createDownloadCompletedNotification(
                     context,
                     download,
@@ -841,9 +839,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.



View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/compare/992d53f7e91d65fbd5cc0bf7203f2d1814c84b61...6ae3342f4b9959b9ac75c412bd20d92ae6117773

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/android-components/-/compare/992d53f7e91d65fbd5cc0bf7203f2d1814c84b61...6ae3342f4b9959b9ac75c412bd20d92ae6117773
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20220224/3cf63030/attachment-0001.htm>


More information about the tbb-commits mailing list