summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/Constants.java
Commit message (Collapse)AuthorAgeFilesLines
* Ensure files get mediascanned after the download is completed.Sudheer Shanka2019-08-131-0/+11
| | | | | | | | | | | | | | | | | | Update file size in MediaStore to 0 before triggering mediascan which should force MediaScanner to scan this file. Also, add a clean-up job to trigger mediscan on already existing downloads which should have been mediascanned but haven't and got stuck in this state. Bug: 138419471 Test: manual Test: atest DownloadProviderTests Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java Test: atest DownloadManagerLegacy Test: atest DownloadManagerApi28 Change-Id: I813086ceba6c70ca42309fcce5f9db209eac1575 (cherry picked from commit c2b0739b08e423e3c9fcde42b095cd72315ecf1f)
* Move DownloadManager to use JobScheduler.Jeff Sharkey2016-04-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JobScheduler is in a much better position to coordinate tasks across the platform to optimize battery and RAM usage. This change removes a bunch of manual scheduling logic by representing each download as a separate job with relevant scheduling constraints. Requested network types, retry backoff timing, and newly added charging and idle constraints are plumbed through as job parameters. When a job times out, we halt the download and schedule it to resume later. The majority of downloads should have ETag values to enable resuming like this. Remove local wakelocks, since the platform now acquires and blames our jobs on the requesting app. When an active download is pushing updates to the database, check for both paused and cancelled state to quickly halt an ongoing download. Shift DownloadNotifier to update directly based on a Cursor, since we no longer have the overhead of fully-parsed DownloadInfo objects. Unify a handful of worker threads into a single shared thread. Remove legacy "large download" activity that was thrown in the face of the user; the UX best-practice is to go through notification, and update that dialog to let the user override and continue if under the hard limit. Bug: 28098882, 26571724 Change-Id: I33ebe59b3c2ea9c89ec526f70b1950c734abc4a7
* Add "Cancel" action to downloads in notification.Oren Blasberg2015-06-251-0/+3
| | | | | | | | | | | | Add a "Cancel" action to in-progress downloads shown in notification pane. We add a new action type for a new "cancel" intent sent by DownloadNotifier to DownloadReceiver, which in turn cancels the download by way of DownloadManager. BUG=19972464 Change-Id: I83cd2f40e1442c327f756027b99f9eac913a0e70
* Scan after writing download files.Jeff Sharkey2014-08-051-3/+0
| | | | | | | | Kicks off media scanner after files are written, usually through a DocumentsProvider. Bug: 13557203 Change-Id: I4e29b778b4e19a217f60c1e415c4d814724752d3
* Many improvements to download storage management.Jeff Sharkey2014-02-061-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all data transfer to occur through FileDescriptors instead of relying on local files. This paves the way for downloading directly to content:// Uris in the future. Rewrite storage management logic to preflight download when size is known. If enough space is found, immediately reserve the space with fallocate(), advising the kernel block allocator to try giving us a contiguous block regions to reduce fragmentation. When preflighting on internal storage or emulated external storage, ask PackageManager to clear private app caches to free up space. Since we fallocate() the entire file, use the database as the source of truth for resume locations, which requires that we fsync() before each database update. Store in-progress downloads in separate directories to keep the OS from deleting out from under us. Clean up filename generation logic to break ties in this new dual-directory case. Clearer enforcement of successful download preconditions around content lengths and ETags. Move all database field mutations to clearer DownloadInfoDelta object, and write back through single code path. Catch and log uncaught exceptions from DownloadThread. Tests to verify new storage behaviors. Fixed existing test to reflect correct RFC behavior. Bug: 5287571, 3213677, 12663412 Change-Id: I6bb905eca7c7d1a6bc88df3db28b65d70f660221
* Revert "change download provider to use system log"Doug Zongker2014-01-271-3/+3
| | | | | This reverts commit 4f9d2d04003fafb358d7c127054055b3a9732c9b, was only wanted for debugging.
* change download provider to use system logDoug Zongker2014-01-271-3/+3
| | | | | | | | Try to catch the download provider in the act of deleting pending system updates. Bug: 12680933 Change-Id: If58aba5c30fd624217e5d073730645af05e98ac7
* Extend trampoline to show dialogs.Jeff Sharkey2013-09-061-1/+1
| | | | | | | | | Handle incoming manage requests by launching finished downloads, or showing various retry dialogs. Pipe through summary, show percentage when in progress, and always show total size and MIME type. Bug: 10531347, 10599641 Change-Id: I3be2bc67ea3c0ef795146177200f5be77ad5114e
* Follow stronger DocumentsProvider contract.Jeff Sharkey2013-08-281-1/+1
| | | | | | | | Provides same functionality, but follows updated DocumentsProvider contract in framework. Bug: 10497206 Change-Id: Ie1f6180047ff7bad289679a14f3368238d47b1d6
* Support custom documents query projections.Jeff Sharkey2013-08-171-1/+1
| | | | | | | | | Uses new MatrixCursor.RowBuilder.offer() to support custom projections. Also query MIME types directly so they're always consistent. Bug: 10329983 Change-Id: I724b26e008f6ffb85940e009a916b969ead42fcd
* Delegate to documents UI; improve contents.Jeff Sharkey2013-08-151-0/+3
| | | | | | | | | When Downloads app is launched, delegate to new documents management UI. Use DownloadManager public API to match the contents of the existing Downloads UI. Bug: 10329983 Change-Id: Iaa1a1dc013cfe3b17d31ecc764d4c4cc13f62258
* Better handling of retryable errors.Jeff Sharkey2013-01-171-3/+0
| | | | | | | | Now the final errors are always thrown, and the outer code decides how to handle them as retries. Also clean up method signatures. Bug: 8022478 Change-Id: I4e7e43be793294ab837370df521e7c381e0bb6c3
* Update extras for in-progress download.Jeff Sharkey2012-11-271-0/+2
| | | | | | | | Follow move to EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS extras, which was missing during refactoring. Bug: 7617373 Change-Id: I26203a2bc6fc0e211a1aa602c0de018332d76f60
* Only delete spurious files belonging to us.Jeff Sharkey2012-04-241-3/+0
| | | | | | | | | When multiple users are active, this can accidentally delete files belonging to other users. Checking owner also helps us avoid deleting recover and lost+found. Bug: 6362988 Change-Id: Ifc165acc9a9b3ab253a4b6257f370836b98b3a74
* Give DownloadManager a useful user agent.Jeff Sharkey2012-04-091-1/+33
| | | | | | | | Include platform version, model, and build, when available. Matches current logic used by Browser. Bug: 6257336 Change-Id: I0addfd944aff13bd4ce4226bb8d6328da6b0f5d5
* Download provider change for DRM Forward Lock plugin:Gloria Wang2011-04-191-4/+0
| | | | | | | to convert .dm files to .fl files during downloading For bug 3188041 Change-Id: I882b851664432fba3e57dc25a6be827b48006e69
* bug:4121206 handle STOPSHIP comments/codeVasu Nori2011-03-171-2/+2
| | | | Change-Id: I3c9f8e3b11dd301a0921d89e0333883489f37e55
* bug:3435895 listen to media_mounted broadcast intentVasu Nori2011-02-081-2/+2
| | | | | | and retry downloads that failed due to the error "sdcard media not mounted" Change-Id: Id181b8167d331214f72679c85f18cc8b9b969e40
* Revert "Merge "bug:3341145 if ignore_size_limits flag set, validate caller's ↵Vasu Nori2011-02-031-0/+3
| | | | | | | perms" into honeycomb" This reverts commit 3e7bb1c5d7e7d1a013df959c1a6947b33df0a0fd, reversing changes made to b2085f61b37ad4a70c799012f25ff62a38173f68.
* bug:3341145 if ignore_size_limits flag set, validate caller's permsVasu Nori2011-02-021-3/+0
| | | | | | and then of course ignore the mobile network size limits Change-Id: I6765be9255187f93bd51acecc19a15db4f324204
* bug:3396889 (HC branch) fix STOPSHIP codeVasu Nori2011-01-261-2/+2
| | | | Change-Id: I1eeb8c5a9936db08bc5997980dc6c7307691034e
* bug:3286430 set quota on downloads data dirVasu Nori2010-12-231-1/+2
| | | | | | | | | | make sure the doanloads data dir size is limited by some quote - 100MB default and 200MB for SR. bug:3286430 tests are in Change-Id: I688f7e058511089bec7fa21e972e23780604d98a Change-Id: Iba7fab9fa91ea018f35e1c3ef5ec0e6b03cba650
* allow run-time verbose debugging option on downloadmanager code.Vasu Nori2010-10-271-2/+2
| | | | | | otherwise, one has to recompile and reflash to get debug output Change-Id: I1d89d7cca3363fa793f74ba805136667e1ce3091
* remove usage of hidden public constants.Vasu Nori2010-10-201-3/+1
| | | | Change-Id: I2edf1bef5e741de8193cb293807e3ace42003b0c
* Disable unnecessary loggingJean-Baptiste Queru2009-09-241-3/+3
| | | | BUG=2134410
* Add logging to track connectivity as seen from the Download Manager.Jean-Baptiste Queru2009-09-211-0/+3
| | | | | | | This is enabled by a separate build-time constant, so that it can be turned on for everyone without having to use a system property. BUG=2055624
* am d3403254: Enable full logging (for easier debugging)Jean-Baptiste Queru2009-07-141-1/+1
|\ | | | | | | | | | | | | Merge commit 'd3403254c3a290b6a68804c36c6876cb3787ec15' * commit 'd3403254c3a290b6a68804c36c6876cb3787ec15': Enable full logging (for easier debugging)
| * Enable full logging (for easier debugging)Jean-Baptiste Queru2009-07-141-1/+1
| | | | | | | | See http://b/1973844
| * auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+151
| |
| * auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-151/+0
| |
* | Match the official code style guide.Jean-Baptiste Queru2009-01-201-1/+1
|/ | | | | | This fixes a number of style violations that weren't caught by automated tools and brings those files closer to compliance with the official style guide for this language.
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-8/+37
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+122