Android-components: Move all download state to browser store

Created on 20 May 2020  路  9Comments  路  Source: mozilla-mobile/android-components

We currently keep additional application state for downloads in the DownloadService (see downloadJobs) and DownloadManager (see queuedDownloads).

Having all this state in the store will make it easier to implement additional download UI in the future. It also solves the problem described in https://github.com/mozilla-mobile/android-components/issues/5217 where we have to pass the download object (and the full URL) to the download intent which may be too large in case of data URIs. If the service has access to the store it can simply read the state from there.

<download> E13 鈱笍 code

Most helpful comment

@Amejia481 Yeah, you're right, if the DownloadState move has been completed, I should be able to make the needed changes in https://github.com/mozilla-mobile/fenix/issues/11371 without any conflicts from the proposed changes in https://github.com/mozilla-mobile/android-components/issues/7227 .

All 9 comments

This is a bigger refactoring and may need to be broken down more once work starts.

Changes made for this have affected the fix for https://github.com/mozilla-mobile/fenix/issues/9044 . I'll take a look on the Fenix side and see how I can resolve those conflicts.

Edit: Or should I wait for this to be finished?

Changes made for this have affected the fix for mozilla-mobile/fenix#9044 . I'll take a look on the Fenix side and see how I can resolve those conflicts.

Edit: Or should I wait for this to be finished?

I think you could continue on Fenix, Is there something in particular that it's blocking you?

@Amejia481 Yeah, you're right, if the DownloadState move has been completed, I should be able to make the needed changes in https://github.com/mozilla-mobile/fenix/issues/11371 without any conflicts from the proposed changes in https://github.com/mozilla-mobile/android-components/issues/7227 .

I want to add a Download Manager Center Activity in my browser powered by android-components.
I want show all download tasks' progress in my activity.But now DownloadState in BrowserState's queuedDownloads don't include download progress.
So I can wait this change to be done.Then I can get download progress from BrowserState?
English is not my mother tongue, if you have any doubt about what I say,please comment me. Thank you very much.

I want to add a Download Manager Center Activity in my browser powered by android-components.
I want show all download tasks' progress in my activity.But now DownloadState in BrowserState's queuedDownloads don't include download progress.
So I can wait this change to be done.Then I can get download progress from BrowserState?
English is not my mother tongue, if you have any doubt about what I say,please comment me. Thank you very much.

We are going to work on a similar feature on Fenix https://github.com/mozilla-mobile/fenix/issues/349
This looks like a great starting issue.

cc @kglazko

I want to add a Download Manager Center Activity in my browser powered by android-components.
I want show all download tasks' progress in my activity.But now DownloadState in BrowserState's queuedDownloads don't include download progress.
So I can wait this change to be done.Then I can get download progress from BrowserState?
English is not my mother tongue, if you have any doubt about what I say,please comment me. Thank you very much.

@marcinwiacek now https://github.com/mozilla-mobile/android-components/pull/7698 landed this should include the values that you need. We are going to work on https://github.com/mozilla-mobile/android-components/issues/7761 next as we want downloads to be on memory in the store even if they are completed, after that we want to work on https://github.com/mozilla-mobile/android-components/issues/7762 for this data to be persisted on disk.

Was this page helpful?
0 / 5 - 0 ratings