Igalia / wolvic

A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://wolvic.org
Mozilla Public License 2.0
798 stars 100 forks source link

Use MediaStore.Downloads to index downloads instead #798

Open HollowMan6 opened 1 year ago

HollowMan6 commented 1 year ago

Currently, we use DownloadManager.addCompletedDownload, but that has been deprecated in API level 29. Using MediaStore.Downloads to index downloads instead will allow us to get rid of all the nasty code we have to copy files from wolvic's storage data to system's

Locations

https://github.com/Igalia/wolvic/pull/787/files#r1251788332

Possible Solution

As suggested in: https://developer.android.com/reference/android/app/DownloadManager#addCompletedDownload(java.lang.String,%20java.lang.String,%20boolean,%20java.lang.String,%20java.lang.String,%20long,%20boolean)

HollowMan6 commented 1 year ago

Hi @MikeRatcliffe! Are you still working on this issue? If not, I will check this one.

MikeRatcliffe commented 1 year ago

Hi @MikeRatcliffe! Are you still working on this issue? If not, I will check this one.

Oops, I dropped this because of life... please take it as I am too busy right now.

HollowMan6 commented 1 year ago

Since MediaStore.Downloads#EXTERNAL_CONTENT_URI is added in API 29, it's not worth doing it now, since the minimum API we support is 24. It would be too complicated to use DownloadManager and ContentResolver at the same time for downloads. So maybe it would be better to do it later when we decide to have 29 as the minimum API so that we can fully deprecate DownloadManager.