Repository navigation
feat: let other apps read the progress of downloads - #130
Open
Anderinfera wants to merge 1 commit into
Open
Anderinfera wants to merge 1 commit into
Anderinfera wants to merge 1 commit into
Conversation
A read-only content provider lists each download with its name, location, state, downloaded bytes and total size. A gallery or a file manager can show the real state of a download instead of guessing it from the size of the file. Reading needs the new READ_DOWNLOAD_PROGRESS permission, which the user grants to each app. Readers are notified at once when a download changes state and at most every 500 ms about its progress. Reading never starts or changes a download.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Other apps (a gallery, a file manager) only see a growing file while PipePipe downloads. They can't tell whether the download is still running, paused, failed or finished, or how big it will be.
This adds a read-only content provider,
content://<applicationId>.downloadprogress/missions. It has one row per download with the columnsid,name,relativePath,uri,bytes,totalandstate(QUEUED,RUNNING,PAUSED,POSTPROCESSING,ERRORorFINISHED).bytesandtotalare -1 unless the download is running. Finished downloads stay listed for one minute.<applicationId>.permission.READ_DOWNLOAD_PROGRESSpermission. It is adangerouspermission, so the user grants it to each app. Debug builds get their own permission name, so they can be installed next to a release build.Validation:
./gradlew assembleDebugbuilds against PipePipeExtractore9818f8e.