summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads
Commit message (Collapse)AuthorAgeFilesLines
* am 04d70252: am 36f06f4c: Merge "DB migration to eliminate some null fields ↵Steve Howard2010-09-231-1/+28
|\ | | | | | | | | | | | | | | | | in old downloads" into gingerbread Merge commit '04d7025262d7f6c5c372ec699d78b18d05b0400b' * commit '04d7025262d7f6c5c372ec699d78b18d05b0400b': DB migration to eliminate some null fields in old downloads
| * am 36f06f4c: Merge "DB migration to eliminate some null fields in old ↵Steve Howard2010-09-231-1/+28
| |\ | | | | | | | | | | | | | | | | | | | | | | | | downloads" into gingerbread Merge commit '36f06f4c8497ab47e64bcc5d8cea12a109fede5e' into gingerbread-plus-aosp * commit '36f06f4c8497ab47e64bcc5d8cea12a109fede5e': DB migration to eliminate some null fields in old downloads
| | * Merge "DB migration to eliminate some null fields in old downloads" into ↵Steve Howard2010-09-231-1/+28
| | |\ | | | | | | | | | | | | gingerbread
| | | * DB migration to eliminate some null fields in old downloadsSteve Howard2010-09-221-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DownloadProvider now ensures that current bytes, total bytes, title and description are never null in the DB. Some new code relies on this assumption for simplicity. That means we need to ensure this invariant is true for pre-existing downloads as well. Change-Id: Iea2289516d2636edf3394678ab08aa9cea31dc69
* | | | am 5dbaa73a: am ebb555c0: Support multi-valued HTTP headers, handle new API ↵Steve Howard2010-09-232-15/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes Merge commit '5dbaa73a7f356f67810becbf3ad258a7dd765e59' * commit '5dbaa73a7f356f67810becbf3ad258a7dd765e59': Support multi-valued HTTP headers, handle new API changes
| * | | am ebb555c0: Support multi-valued HTTP headers, handle new API changesSteve Howard2010-09-232-15/+17
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 'ebb555c0687061993dd6a22d15f6aab2437ee8c5' into gingerbread-plus-aosp * commit 'ebb555c0687061993dd6a22d15f6aab2437ee8c5': Support multi-valued HTTP headers, handle new API changes
| | * | Support multi-valued HTTP headers, handle new API changesSteve Howard2010-09-222-15/+17
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | * backend support for multiple values for the same HTTP headers, for corresponding API changes * other minor changes in response to DownloadManager API changes Change-Id: I7c595e94a60ed7afaca6cc3fb4c05aaeeff20c2a
* | | am 7b96b251: am d3197296: Implement dialogs for wifi required + recommended ↵Steve Howard2010-09-216-25/+240
|\| | | | | | | | | | | | | | | | | | | | | | | | | | limits. Merge commit '7b96b251c0404ed3f05652bd7d5209910fb999cc' * commit '7b96b251c0404ed3f05652bd7d5209910fb999cc': Implement dialogs for wifi required + recommended limits.
| * | am d3197296: Implement dialogs for wifi required + recommended limits.Steve Howard2010-09-216-25/+240
| |\| | | | | | | | | | | | | | | | | | | Merge commit 'd319729622da1893e895f2e35f41d01ecdca3705' into gingerbread-plus-aosp * commit 'd319729622da1893e895f2e35f41d01ecdca3705': Implement dialogs for wifi required + recommended limits.
| | * Implement dialogs for wifi required + recommended limits.Steve Howard2010-09-216-25/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change extends the original work to add a size limit over which wifi is required to download a file. First, this change adds a second size limit, over which wifi is recommended but not required. The user has the option to bypass this limit. Second, this change implements dialogs shown to the user when either limit is exceeded. These dialogs are shown by the background download manager service when a download is started and found to be over the limit (and wifi is not connected). I'm including one small fix to the unit tests needed from the previous change. Change-Id: Ia0f0acaa7b0d00e98355925c3446c0472048df10
* | | am 2031fa7b: am dc738781: Merge "Improve file error reporting + new detailed ↵Steve Howard2010-09-203-67/+103
|\| | | | | | | | | | | | | | | | | | | | | | | | | | error messages in UI" into gingerbread Merge commit '2031fa7bad5ef3e31cf0ea73d0b9bf4670842cf0' * commit '2031fa7bad5ef3e31cf0ea73d0b9bf4670842cf0': Improve file error reporting + new detailed error messages in UI
| * | am dc738781: Merge "Improve file error reporting + new detailed error ↵Steve Howard2010-09-203-67/+103
| |\| | | | | | | | | | | | | | | | | | | | | | | | | messages in UI" into gingerbread Merge commit 'dc738781156d0f5ac1db62838d42c876d740810d' into gingerbread-plus-aosp * commit 'dc738781156d0f5ac1db62838d42c876d740810d': Improve file error reporting + new detailed error messages in UI
| | * Improve file error reporting + new detailed error messages in UISteve Howard2010-09-203-67/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * support new error code for "destination file already exists" * improve error handling for various file error cases to return a more specific error code when appropriate * make UI support more detailed error messages for some cases * use Uri.getPath() instead of Uri.getSchemeSpecificPart() for file URIs Change-Id: Icb01d4d3b47c7776be3ddcd8347212e950cd023e
* | | am b9115af1: am 3398db8f: Fix notification bugs, cleanup DownloadService + ↵Steve Howard2010-09-207-641/+470
|\| | | | | | | | | | | | | | | | | | | | | | | | | | DownloadReceiver Merge commit 'b9115af1e7b39a25c00aed7c9d3bb413ecef9eda' * commit 'b9115af1e7b39a25c00aed7c9d3bb413ecef9eda': Fix notification bugs, cleanup DownloadService + DownloadReceiver
| * | am 3398db8f: Fix notification bugs, cleanup DownloadService + DownloadReceiverSteve Howard2010-09-207-641/+470
| |\| | | | | | | | | | | | | | | | | | | Merge commit '3398db8f3b195959faa2a7cf09918f364432ac28' into gingerbread-plus-aosp * commit '3398db8f3b195959faa2a7cf09918f364432ac28': Fix notification bugs, cleanup DownloadService + DownloadReceiver
| | * Fix notification bugs, cleanup DownloadService + DownloadReceiverSteve Howard2010-09-207-641/+470
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change started out just fixing a few regressions related to notifications: * Browser downloads weren't picking up a title from the determined filename. This was due to my change to default the title field to "" instead of null. * Notification click/hide events weren't being handled properly. This was due to previous change to the URI structure of DownloadProvider. DownloadReceiver needed to be changed to perform queries through /all_downloads URIs, like all other parts of the download manager code. I did some general refactoring of the DownloadReceiver code while I was there. * The code in DownloadNotification wasn't picking up some updates to downloads properly. This was due to my change to make DownloadNotification use the DownloadInfo objects rather than querying the database directly, so that it could make use of info provided by the DownloadThread that didn't go into the DB. Fixing this didn't turn out to be all that complicated, but along the way to figuring this out I made some substantial refactoring in DownloadService which made it much cleaner anyway and eliminated a lot of duplication. That's something that had to happen eventually, so I'm leaving it all in. Change-Id: I847ccf80e3d928c84e36bc24791b33204104e1b2
* | | am e8027017: am 4bebe75b: Temporary fix to support old URIs for MarketSteve Howard2010-09-181-1/+6
|\| | | | | | | | | | | | | | | | | | | | Merge commit 'e80270177d1b504525d1f4ea4139b0c213fea891' * commit 'e80270177d1b504525d1f4ea4139b0c213fea891': Temporary fix to support old URIs for Market
| * | am 4bebe75b: Temporary fix to support old URIs for MarketSteve Howard2010-09-171-1/+6
| |\| | | | | | | | | | | | | | | | | | | Merge commit '4bebe75b3e2361d7fb0aa966598c41c45ad9317f' into gingerbread-plus-aosp * commit '4bebe75b3e2361d7fb0aa966598c41c45ad9317f': Temporary fix to support old URIs for Market
| | * Temporary fix to support old URIs for MarketSteve Howard2010-09-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Market has its own copies of the download manager URIs. This change bring back support for those so Market will keep working until they can properly update their code. Change-Id: I283ea65931085c0f083a182842d362c113427537
* | | am 176a7442: resolved conflicts for merge of 3d55d829 to gingerbread-plus-aospSteve Howard2010-09-166-230/+236
|\| | | | | | | | | | | | | | | | | | | | Merge commit '176a74426f750dc56e7d200a4cdc3b6ed75fe6cd' * commit '176a74426f750dc56e7d200a4cdc3b6ed75fe6cd': New URI structure with "my_downloads" and "all_downloads"
| * | resolved conflicts for merge of 3d55d829 to gingerbread-plus-aospSteve Howard2010-09-166-230/+236
| |\| | | | | | | | | | Change-Id: I18ede2f2d5ad8aa40cd61bdb7213659d356fdf57
| | * New URI structure with "my_downloads" and "all_downloads"Steve Howard2010-09-146-231/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a second view into the download manager database via a set of URIs starting with /all_downloads, renaming the original /download URIs to /my_downloads. In addition to making things more clear, this change allows the downloads UI to grant permissions on individual downloads to viewer apps. The old semantics were: * for ordinary callers, /download included only downloads initiated by the calling UID * for intraprocess calls or calls by root, /download included all downloads The new semantics are * /my_downloads always includes only downloads initiated by the calling UID, and requires only INTERNET permission. It could just as well require no permission, but that's not possible in the framework, since path-permissions can only broaden access, not tighten it. It doesn't matter, because these URIs are useless without INTERNET permission -- if a user can't initiate downloads, there's no reason to read this. * /all_downloads always includes all downloads on the system, and requires the new permission ACCESS_ALL_DOWNLOADS. This permission is currently protectionLevel=signature -- this could be relaxed later to support third-party download managers. All download manager code has been changed to use /all_downloads URIs, except when passing a URI to another app. In making this change across the download manager code, I've taken some liberties in cleaning things up. Other apps are unchanged and will use /my_downloads. Finally, this incorporates changes to DownloadManager to return a content URI for /cache downloads -- the download UI no longer assumes it's a file URI, and it grants permissions to the receiver of the VIEW intent. The public API test has also been updated. I've also fixed some null cursor checking in DownloadManager. Change-Id: I05a501eb4388249fe80c43724405657c950d7238
* | | am d5c0120a: am 13db2005: Merge "Fix silly bug with completed ↵Steve Howard2010-09-121-2/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | notifications." into gingerbread Merge commit 'd5c0120af6eae66f15e83ef61eb61ea19542b097' * commit 'd5c0120af6eae66f15e83ef61eb61ea19542b097': Fix silly bug with completed notifications.
| * | am 13db2005: Merge "Fix silly bug with completed notifications." into ↵Steve Howard2010-09-121-2/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | gingerbread Merge commit '13db200521cf8ead0d96173bccd7e141182eeccd' into gingerbread-plus-aosp * commit '13db200521cf8ead0d96173bccd7e141182eeccd': Fix silly bug with completed notifications.
| | * Merge "Fix silly bug with completed notifications." into gingerbreadSteve Howard2010-09-121-2/+1
| | |\
| | | * Fix silly bug with completed notifications.Steve Howard2010-09-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This functionality isn't part of the public API, hence it lacks test coverage. Rather than adding tests, I'm inclined to leave it and hopefully we'll be able to migrate existing apps to the public API soon enough. Change-Id: I1210c6525dfb7cb12c1b8e35c04684060d3ad87e
* | | | am 7fa71b17: am 71e7fda9: Further work on the new downloads UI.Steve Howard2010-09-122-3/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '7fa71b17d1bcaceb4688cb4b0e6982d1db4a0538' * commit '7fa71b17d1bcaceb4688cb4b0e6982d1db4a0538': Further work on the new downloads UI.
| * | | am 71e7fda9: Further work on the new downloads UI.Steve Howard2010-09-122-3/+35
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '71e7fda9135a0915af1fd419d07ebf85ad09beb4' into gingerbread-plus-aosp * commit '71e7fda9135a0915af1fd419d07ebf85ad09beb4': Further work on the new downloads UI.
| | * | Further work on the new downloads UI.Steve Howard2010-09-102-3/+35
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add support for downloads not visible in the UI * add support for restarting failed downloads and downloads for which the file is missing * add "clear selection" button to selection menu * fix DateSortedExpandableListAdapter to ensure the view refreshes properly anytime the underlying data changes * make DownloadList handle when a selected download gets deleted by another app * make DownloadList close a dialog for a pending download when the download starts * show a dialog when the user tries to open a download but the file is missing * display "<Unknown>" when no title is provided for a download * add a test case for DownloadManager.orderBy() (should've gone in the previous commit) Change-Id: Ibf3062e8228e7f2c1270be24d8d5527dfb064658
* | | am caab8ef3: am 89e4816f: Added support for downloading files with unicode ↵Andreas Sandblad2010-08-301-2/+52
|\| | | | | | | | | | | | | | | | | | | | | | | | | | characters Merge commit 'caab8ef3d5eac4b64aef7042078a542bb52f3bda' * commit 'caab8ef3d5eac4b64aef7042078a542bb52f3bda': Added support for downloading files with unicode characters
| * | am 89e4816f: Added support for downloading files with unicode charactersAndreas Sandblad2010-08-301-2/+52
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '89e4816fe5f06f4bc2c2fe0e38e63c7fbe468cd7' into gingerbread-plus-aosp * commit '89e4816fe5f06f4bc2c2fe0e38e63c7fbe468cd7': Added support for downloading files with unicode characters
| | * | Added support for downloading files with unicode charactersAndreas Sandblad2010-08-301-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently only certain ASCII characters are allowed in a filename, all other characters are replaced with an underscore. This gives bad usability for foreign languages (e.g. japanese). This fix replaces the current regexp with a method which replaces only those characters unsafe to be used on VFAT filesystems (should work on most other filesystems as well). Change-Id: I114d47b4b35f28490e6b12493138355532fda499
* | | | am 9877c7f8: am 97d590d5: Add UI message when queued for wifi due to size.Steve Howard2010-08-244-98/+88
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '9877c7f8414bfa1feb49b2afe166f99fff678794' * commit '9877c7f8414bfa1feb49b2afe166f99fff678794': Add UI message when queued for wifi due to size.
| * | | am 97d590d5: Add UI message when queued for wifi due to size.Steve Howard2010-08-204-98/+88
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | Merge commit '97d590d5a1f583acb7992d20851bdc6cd0454d12' into gingerbread-plus-aosp * commit '97d590d5a1f583acb7992d20851bdc6cd0454d12': Add UI message when queued for wifi due to size.
| | * | Add UI message when queued for wifi due to size.Steve Howard2010-08-204-98/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it stands, when a download is paused because it's too big to proceed over mobile, and must proceed over wifi, it looks like any other paused download, with no indication of why it's paused. That may be passable for most other reasons for pausing a download, but it seems too confusing for this case. So this change adds a simple string message that replaces the progress bar when a download is paused for this reason (the icon also changes to a warning). The implementation isn't beautiful and could use some improvement, but I think it's acceptable and necessary. The exact UI design and wording are certainly open to change. Change-Id: I753d57f463e2614b5694bdc178d2a51066da8ca3
* | | | am b14c9649: am 1df61f0e: Avoid endless restarts when waiting for connectivity.Steve Howard2010-08-211-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 'b14c9649a85152aaf87117fa376bbcd46e754cde' * commit 'b14c9649a85152aaf87117fa376bbcd46e754cde': Avoid endless restarts when waiting for connectivity.
| * | | am 1df61f0e: Avoid endless restarts when waiting for connectivity.Steve Howard2010-08-191-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '1df61f0e1a275961ad9762ffc1d141adb91870e0' into gingerbread-plus-aosp * commit '1df61f0e1a275961ad9762ffc1d141adb91870e0': Avoid endless restarts when waiting for connectivity.
| | * | Avoid endless restarts when waiting for connectivity.Steve Howard2010-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding an extra check for usable network connectivity to avoid an endless restart-pause loop while waiting for usable connectivity. Change-Id: If4da9ad222993b5479ada658508f445d10a42013
* | | | resolved conflicts for merge of 2f3c8c7e to masterSteve Howard2010-08-181-2/+10
|\| | | | | | | | | | | | | | | Change-Id: Idcaa37fc828bfae41a150f2cce7b55fa152987be
| * | | am 7bdfb134: Merge "Fix and test handling of null/empty download fields." ↵Steve Howard2010-08-181-2/+10
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into gingerbread Merge commit '7bdfb134c6c1c4e3d4c5da61327e62bc38407c95' into gingerbread-plus-aosp * commit '7bdfb134c6c1c4e3d4c5da61327e62bc38407c95': Fix and test handling of null/empty download fields.
| | * | Fix and test handling of null/empty download fields.Steve Howard2010-08-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Minor change to make title/description default to blank stings, and add test case covering all null/empty download fields. Change-Id: Id44344bc2e464f46589faed49c8f383a45a8d329
* | | | am fa5175e5: am adb6887d: Clean up error codes returned by download manager.Steve Howard2010-08-173-90/+99
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 'fa5175e572258fba0cd55e1c8a01b654178e3f1e' * commit 'fa5175e572258fba0cd55e1c8a01b654178e3f1e': Clean up error codes returned by download manager.
| * | | am adb6887d: Clean up error codes returned by download manager.Steve Howard2010-08-173-90/+99
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 'adb6887d3270d180c94eaf90878d5b67d74a8f28' into gingerbread-plus-aosp * commit 'adb6887d3270d180c94eaf90878d5b67d74a8f28': Clean up error codes returned by download manager.
| | * | Clean up error codes returned by download manager.Steve Howard2010-08-163-90/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This set of changes cleans up the error codes returned by the download manager in various failure cases, aiming for improved consistency. Error codes are part of the public API so it's important to get this right now. The main changes here are: * Refactoring the flow of error status information throughout DownloadThread to make it more explicit, by having StopRequest accept a status code in its constructor and eliminating State.mFinaStatus. * Eliminating the use of valid HTTP 4xx statuses when those statuses weren't actually returned by the server. Now, if the returned error code is a valid HTTP status code, that means it was returned by the server. These cases have been replaced with more sensible artificial error codes, including a new ERROR_CANNOT_RESUME when an interrupted download can't be resumed. * Improvements to some of the error handling code paths -- ensuring we don't clear the cache for external downloads, ensuring we don't fail with CANNOT_RESUME when the download hasn't actually started yet, removing the restriction on acceptable mime types for public API downloads. Change-Id: I0d825845fe0fe7ed5df74bad26e8d34ac0d1cc4e
* | | | am e80c3555: am e61798da: Extend PublicApiAccessTest to exercise ↵Steve Howard2010-08-161-0/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DownloadManager. Merge commit 'e80c35557bd72489323303af9d93c2c33c88cce9' * commit 'e80c35557bd72489323303af9d93c2c33c88cce9': Extend PublicApiAccessTest to exercise DownloadManager.
| * | | am e61798da: Extend PublicApiAccessTest to exercise DownloadManager.Steve Howard2010-08-161-0/+8
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 'e61798da80558450f580ed948d0d469bd6423d8e' into gingerbread-plus-aosp * commit 'e61798da80558450f580ed948d0d469bd6423d8e': Extend PublicApiAccessTest to exercise DownloadManager.
| | * | Extend PublicApiAccessTest to exercise DownloadManager.Steve Howard2010-08-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a new test case to PublicApiAccessTest to enqueue a request through DownloadManager, ensuring that the values constructed by DownloadManager fit within the allowed bounds. It also fixes a bug with allowing http header values exposed by the new test. Change-Id: I94fec57d7a41298ac42ddaab338516e6a60c4e75
* | | | am 1d332ceb: am da5a4183: Merge "Make all public API downloads visible." ↵Steve Howard2010-08-061-2/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into gingerbread Merge commit '1d332ceb5756ef2e09ae97f1735aa9b529063874' * commit '1d332ceb5756ef2e09ae97f1735aa9b529063874': Make all public API downloads visible.
| * | | am da5a4183: Merge "Make all public API downloads visible." into gingerbreadSteve Howard2010-08-061-2/+9
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 'da5a4183312f520cf35b154d33cb7205e6ba5557' into gingerbread-plus-aosp * commit 'da5a4183312f520cf35b154d33cb7205e6ba5557': Make all public API downloads visible.
| | * | Make all public API downloads visible.Steve Howard2010-07-281-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes all downloads through the public API visible by default. It removes the API that had allowed applications to control notifications while the download runs. This has been replaced with a hidden API, since such behavior is needed by SystemUpdater and Market (for self-updates). Additionally, the behavior is now protected by a new permission. I'm making this permission signatureOrSystem, and changing the non-purgeable permission to the same (it should've been that, I just didn't know). I'm also adding string descriptions to appease the translation folks. Change-Id: I192e8b19ff9b0e425257cef0db081c3d75996ea5