Closed Bug 1970176 Opened 1 year ago Closed 11 months ago

[Downloads v2] Refactor DownloadEstimator

Categories

(Firefox for Android :: Downloads, task)

All
Android
task

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: npoon, Assigned: npoon)

References

Details

(Whiteboard: [fxdroid] [group4])

Attachments

(1 file)

At the moment, DownloadEstimator takes totalBytes as a dependency. (sf). This means that we initialize this once per download but this makes it tricky for live downloads in the downloads screen because it's hard to find a place to initialize / store this.

We should investigate removing this dependency and instead, making the estimatedRemainingTime method take totalBytes as a parameter. Then, we can fix where we initialize DownloadEstimator for live downloads. Currently, it's in DefaultFileItemDescriptionProvider (added in Bug 1965511).

After this, we should also investigate if we can remove this dependency from DownloadJobState in AbstractFetchDownloadService. (sf). This was a temporary hack and is advised against because data classes should hold data and download estimator is not data

Summary: Refactor DownloadEstimator → [Downloads v2] Refactor DownloadEstimator
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: