summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Updated assets for downloads UI launcher icon" into gingerbreadSteve Howard2010-10-042-0/+0
|\
| * Updated assets for downloads UI launcher iconSteve Howard2010-09-282-0/+0
| | | | | | | | Change-Id: I0dc0ef687ebc33a19b3af070df2722840a20eba1
* | Merge "Seriously improve error reporting in DownloadThread." into gingerbreadSteve Howard2010-10-014-198/+164
|\ \
| * | Seriously improve error reporting in DownloadThread.Steve Howard2010-09-304-198/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My old error reporting strategy for DownloadThread was to log the stack trace for the exception, so we'd know exactly what conditions caused the StopRequest. hackbod suggested that we shouldn't log tracebacks as they clutter the log. Instead, we should just always include a little string tag explaining why the request is being stopped -- this is more concise and more useful to developers. There are three main changes here to acheive this goal: * make StopRequest require a short, log-friendly error message upon construction, and add such a message to all construction sites * make a similar change to GenerateSaveFileError, so that the variety of errors that originate with Helpers.generateSaveFile() get similarly fine-grained and concise error reporting * make network usable checking code return a distinct error code for each distinct negative condition, and add a utility to return a log-friendly error message for each such code. Finally, I cleaned up some of the ways errors/exceptions are handled in the process. Change-Id: Ie70cbf3f2960e260e97f8449258e25218d0f900f
* | | Avoid NPE when checking file URI in DownloadProviderSteve Howard2010-09-301-1/+2
|/ / | | | | | | Change-Id: Ic937b05308cecce244725e25767a3a1310a8463d
* | Merge "Handle null local URI when deleting a download." into gingerbreadSteve Howard2010-09-301-3/+5
|\ \
| * | Handle null local URI when deleting a download.Steve Howard2010-09-301-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | I'd written this to assume a non-null local URI, but I forgot the legacy downloads can still have null local URI, so this handling needs to remain until the legacy API is dead and gone. Change-Id: Icfe8dc2a6fead03b09cabe684c713fb6f0e6c1ab
* | | Merge "Import revised translations. DO NOT MERGE" into gingerbreadEric Fischer2010-09-3040-121/+1161
|\ \ \
| * | | Import revised translations. DO NOT MERGEEric Fischer2010-09-2940-121/+1161
| | | | | | | | | | | | | | | | Change-Id: I27a5fc3ab9bd0fd3e6d9db674ef32077d623e7b6
* | | | Make downloads UI singleTop.Steve Howard2010-09-301-1/+2
| |/ / |/| | | | | | | | | | | | | | | | | | | | Browser downloads, when clicked, will launch the downloads UI. When clicked from the downloads UI (as opposed to a notification), we don't want to launch a second copy of the downloads UI activity. Change-Id: I0ae546bb423814f1bd1d6481085bf5f237d1213b
* | | Improve how the download manager reports paused statuses.Steve Howard2010-09-299-127/+105
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes the download manager report more detail when a download is paused. Rather than always reporting status RUNNING_PAUSED, there are now four different statuses: * paused by the app * waiting to retry after a network error * waiting for network connectivity * queued for wifi due to size limits This allows a few improvements: * code deciding when to run a download can be improved and cleaned up (I've taken some extra steps in cleaning up this particular code) * notification code no longer has to rely on the in-memory-only "mPausedReason" member of DownloadInfo; instead, it knows from the status that the download is queued for wifi, and can display the appropriate string. This moves the string fetching out into the UI-specific logic and is a sign that this is really the right way to do things. And finally, the real motivation for this change: I've changed the meaning of "Queued" in the downloads UI so it now means "Queued for WiFi'. This is what was originally intended, I'd misunderstood. What was formerly known as "Queued", a download that hadn't started, is now displayed as "In progress" (it's always a transient state so it's basically meaningless anyway). Otherwise it remains the same (in particular, downloads paused for other reasons are still reported as "In progress"). I've also increased some of the logging in DownloadThread a bit, as this change initally introduced some bugs that were impossible to track down without that logging. There have been other bug reports that were impossible to diagnose and these few extra log statements should really help, without cluttering logs too much. I've taken care to avoid potentially introducing any PII into the logs. Change-Id: Id0b8d65fc8e4406ad7ffa1439ffc22a0281b051f
* | Merge "Split strings with SD card references into variations." into gingerbreadEric Fischer2010-09-291-1/+3
|\ \
| * | Split strings with SD card references into variations.Eric Fischer2010-09-281-1/+3
| | | | | | | | | | | | Change-Id: I62562315a3b0691ee3a541e320b42463cff65265
* | | Merge "Trim the database & check spurious files off the UI thread." into ↵Brad Fitzpatrick2010-09-281-2/+3
|\ \ \ | |_|/ |/| | | | | gingerbread
| * | Trim the database & check spurious files off the UI thread.Brad Fitzpatrick2010-09-281-2/+3
| |/ | | | | | | Change-Id: I92180fc4344579b93361d5584243688a1cfdd091
* / Moved DownloadManager to android.app (DO NOT MERGE)Steve Howard2010-09-2710-10/+10
|/ | | | | | | I'll merge this manually, as there's some additional master-only code that will be to be simultaneously changed. Change-Id: Ifdb1740f32e228bc07f266585737b98a7b794685
* Ensure that downloads UI switches to/from empty view as neededSteve Howard2010-09-271-8/+33
| | | | | Change-Id: I0eef5efd7affc34c465ce04234713874c8d6937e Bug: 3038070
* UI + string tweaks for downloads UI + size limits UISteve Howard2010-09-265-22/+63
| | | | | | | | | * tweaks to UI strings based on feedback * new "retry" button for single selection of failed download * make SizeLimitActivity translucent+titleless, so it looks like a dialog over the current app Change-Id: I6a990275880d23ab6b4368d39b70f0ad042825ec
* Merge "Make downloads UI accept new intent action." into gingerbreadSteve Howard2010-09-241-0/+4
|\
| * Make downloads UI accept new intent action.Steve Howard2010-09-241-0/+4
| | | | | | | | Change-Id: I08c96e1c834fa599e05f18c4c05c3ad5339c3c74
* | Import revised translations. DO NOT MERGEEric Fischer2010-09-2420-29/+389
|/ | | | Change-Id: I0baa17a7069b8e31720524e73f60e7ecf4b3dfe2
* 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
* | Support multi-valued HTTP headers, handle new API changesSteve Howard2010-09-224-20/+22
|/ | | | | | | | | * 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
* Expose permission to download without notification.Steve Howard2010-09-212-3/+4
| | | | Change-Id: I43d3b9ca4ea7d4786a47363b4f5f7e6f003013bb
* Implement dialogs for wifi required + recommended limits.Steve Howard2010-09-2110-26/+293
| | | | | | | | | | | | | | | | | | | 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
* Display time for today's downloads, delete files on externalSteve Howard2010-09-202-2/+47
| | | | | | | | | | | * in downloads UI, for downloads that occurred today, display the time of day rather than the date * when deleting a download on external from the downloads UI, explicitly delete the underlying file as well (the service only deletes cache files when deleting a download from the database, it intentionally leaves external files around) Change-Id: I9aa02dabe3c091a67e2c2196a0ea2f313bcdcef0
* Merge "Improve file error reporting + new detailed error messages in UI" ↵Steve Howard2010-09-206-74/+184
|\ | | | | | | into gingerbread
| * Improve file error reporting + new detailed error messages in UISteve Howard2010-09-206-74/+184
| | | | | | | | | | | | | | | | | | | | | | * 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
* | Fix DownloadProvider makefile to correctly include sub-makefilesSteve Howard2010-09-201-5/+2
|/ | | | Change-Id: I569e168267305939197e9af86f9598b17283a2c6
* New assets for download manager UI.Steve Howard2010-09-207-3/+4
| | | | | | Includes new launcher icon and new icon/string for sorting by time. Change-Id: I5b87da9d5fa53184b1a3096f25e0d45678aa1700
* Fix notification bugs, cleanup DownloadService + DownloadReceiverSteve Howard2010-09-209-646/+476
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Temporary fix to support old URIs for MarketSteve Howard2010-09-172-1/+9
| | | | | | | | 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
* New URI structure with "my_downloads" and "all_downloads"Steve Howard2010-09-1412-248/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use new status bar text styles in download notification.Steve Howard2010-09-121-22/+18
| | | | | | | This avoids the black text on black background problem with new themes. Change-Id: I3e05a2a4035dc5837dad67d889f92864c619c6b5
* 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
* | Further work on the new downloads UI.Steve Howard2010-09-108-25/+258
|/ | | | | | | | | | | | | | | | | | | | * 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
* Import revised translations. DO NOT MERGEEric Fischer2010-09-1020-40/+20
| | | | Change-Id: I806756f787cd261ca5cfdb8aeb40b1e6681c7f42
* First pass at new system UI for download manager.Steve Howard2010-09-0818-2/+1486
| | | | | | | | | | | | | | | | | This is the initial checkin for a new system UI for the download manager. This UI shows all entries present in the Download Manager database, sorted by either date or size. It allows the user to monitor status, open files, and delete/cancel entries. The code was initially copied from the "Downloads" page of packages/apps/Browser, since the design is based on that UI. Much of the code is changed, although DateSortedExpandableListAdapter is nearly identical. The code is not quite finished, but this is very much a working first pass. Change-Id: I7fe102e9f2998e57d893cc3c0f5f6da1cf2db549
* Import revised translations. DO NOT MERGEEric Fischer2010-08-2720-1/+41
| | | | Change-Id: Ic5de3f973bab21a4d09d375cca1e6775eb1612d7
* Add UI message when queued for wifi due to size.Steve Howard2010-08-206-99/+109
| | | | | | | | | | | | | | | | 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
* 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
* Merge "Fix and test handling of null/empty download fields." into gingerbreadSteve Howard2010-08-182-2/+22
|\
| * Fix and test handling of null/empty download fields.Steve Howard2010-08-182-2/+22
| | | | | | | | | | | | | | Minor change to make title/description default to blank stings, and add test case covering all null/empty download fields. Change-Id: Id44344bc2e464f46589faed49c8f383a45a8d329
* | Import revised translations. DO NOT MERGEEric Fischer2010-08-1720-165/+85
|/ | | | Change-Id: Ie97669dcd7a43f4f408beeee7ab7e65d9114731d
* Clean up error codes returned by download manager.Steve Howard2010-08-164-99/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Extend PublicApiAccessTest to exercise DownloadManager.Steve Howard2010-08-162-0/+28
| | | | | | | | | 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
* Import revised translations. DO NOT MERGEEric Fischer2010-08-1020-40/+120
| | | | Change-Id: Ib2ce8f6ee48925ab4371c39266ef4696cb812f91
* Merge "Make all public API downloads visible." into gingerbreadSteve Howard2010-08-065-24/+58
|\