| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I5897c2ba31070f3c6b8225720db12eef5364777f
|
|\
| |
| |
| |
| |
| |
| | |
Merge commit 'fa5175e572258fba0cd55e1c8a01b654178e3f1e'
* commit 'fa5175e572258fba0cd55e1c8a01b654178e3f1e':
Clean up error codes returned by download manager.
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'adb6887d3270d180c94eaf90878d5b67d74a8f28' into gingerbread-plus-aosp
* commit 'adb6887d3270d180c94eaf90878d5b67d74a8f28':
Clean up error codes returned by download manager.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
DownloadManager.
Merge commit 'e80c35557bd72489323303af9d93c2c33c88cce9'
* commit 'e80c35557bd72489323303af9d93c2c33c88cce9':
Extend PublicApiAccessTest to exercise DownloadManager.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'e61798da80558450f580ed948d0d469bd6423d8e' into gingerbread-plus-aosp
* commit 'e61798da80558450f580ed948d0d469bd6423d8e':
Extend PublicApiAccessTest to exercise DownloadManager.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I5ff563b44875bf1668a906c45420e303be614881
|
|\ \ \ \
| |/ / /
|/| / /
| |/ /
| | |
| | |
| | | |
Merge commit 'b986eca2ca6764f1f3ed60ebfb82a8d8306acbac'
* commit 'b986eca2ca6764f1f3ed60ebfb82a8d8306acbac':
Import revised translations. DO NOT MERGE
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '99de0992f03c5b4a1611d25db1df0773433dea7c' into gingerbread-plus-aosp
* commit '99de0992f03c5b4a1611d25db1df0773433dea7c':
Import revised translations. DO NOT MERGE
|
| | |
| | |
| | |
| | | |
Change-Id: Ib2ce8f6ee48925ab4371c39266ef4696cb812f91
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
into gingerbread
Merge commit '1d332ceb5756ef2e09ae97f1735aa9b529063874'
* commit '1d332ceb5756ef2e09ae97f1735aa9b529063874':
Make all public API downloads visible.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'da5a4183312f520cf35b154d33cb7205e6ba5557' into gingerbread-plus-aosp
* commit 'da5a4183312f520cf35b154d33cb7205e6ba5557':
Make all public API downloads visible.
|
| | |\ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: Ic4df1a4487552342e398a4c0ae94c33b7a448976
|
|\| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Merge commit '5f587436aad18acc3bbf6577872cc80b0af980d2'
* commit '5f587436aad18acc3bbf6577872cc80b0af980d2':
Import revised translations. DO NOT MERGE
|
| |\| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Merge commit 'a3c9f66a80c4d801b893f7867041f34d902156fe' into gingerbread-plus-aosp
* commit 'a3c9f66a80c4d801b893f7867041f34d902156fe':
Import revised translations. DO NOT MERGE
|
| | |/
| | |
| | |
| | | |
Change-Id: Ic6f84636b3bbb635ecc790711ba5828dd094f878
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '3253c05afccc0cb62c29958d023d863222a5845c'
* commit '3253c05afccc0cb62c29958d023d863222a5845c':
Get wifi limit from secure settings.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '0d4f9f105c3a31475a36e9a1edfa868c66ff455f' into gingerbread-plus-aosp
* commit '0d4f9f105c3a31475a36e9a1edfa868c66ff455f':
Get wifi limit from secure settings.
|
| | |
| | |
| | |
| | | |
Change-Id: I750654c28cb3d9f9aa67bd56e4d8d770dbfde4b4
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '92ae639f324084a23a54812ab92304b009a93340'
* commit '92ae639f324084a23a54812ab92304b009a93340':
Add test for many interruptions to a single download.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'dea0a5f8e5804d3aba40eaa7de763dd88058384e' into gingerbread-plus-aosp
* commit 'dea0a5f8e5804d3aba40eaa7de763dd88058384e':
Add test for many interruptions to a single download.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adding a new test case for downloads that undergo many interruptions
(as may happen with a very large download that takes many hours).
Includes some refactoring in the test suite.
Early on, this test exposed a race condition in which the download
manager got some I/O exception while reading from the MockWebServer.
I went in and improved/refactored much of the error logging code in
DownloadThread to try and track this down. Unfortunately, once I
finished, the race condition no longer seems to be reproducible, even
with hundreds of runs of the test case. So I've given up on it for
now. In any event, error logging is better and much duplicate code
has been eliminated.
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '915912de0373b78de4cd7cc1f45dad760ef94243'
* commit '915912de0373b78de4cd7cc1f45dad760ef94243':
Improved support for 302/307 redirects.
|
| |\|
| | |
| | |
| | | |
Change-Id: I0adb03f16a6f0cc648886e02c79ffde63e18f99f
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Change the download manager's handling of 302/307 temporary redirects
so that after an interruption of any kind, the delayed retry/resume
will return to the original URI. This complies better with the HTTP
spec. This change also makes the download manager handle other
redirects immediately rather than using the delay that's otherwise
applied to download errors.
I made one more method extraction in DownloadThread to simplify this
change, pulling the top-level logic for a single request into
executeDownload(). It was then just a matter of introducing a new
RetryDownload exeception, similar to StopRequest, and making the
redirection code use it.
Change-Id: Ic719c5725a9fd2e5eebe4dc03453ee71d9f27cd4
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
downloads.
Merge commit '7a8bf08fe936a1fdb0408dea1ec2f39b83acc5d7'
* commit '7a8bf08fe936a1fdb0408dea1ec2f39b83acc5d7':
Fix bug with closing output stream for external downloads.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'f6b4c24b4a876daa3f4e91d6da418983222b9dfd' into gingerbread-plus-aosp
* commit 'f6b4c24b4a876daa3f4e91d6da418983222b9dfd':
Fix bug with closing output stream for external downloads.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I added a unit test to cover this, and it caught another issue with
disallowing external destinations outside of the default downloads
directory (which are now allowed with the new API).
Change-Id: I4df6442bebb06458ad28c85f6bc8cbcbf3ce67a1
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'b6ba05828ace9546e5e27d3745e7cbcba323b66d'
* commit 'b6ba05828ace9546e5e27d3745e7cbcba323b66d':
Serialize threading for download manager testing.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'e6a05a1aa4697440e9630d12b741b3bae321fe49' into gingerbread-plus-aosp
* commit 'e6a05a1aa4697440e9630d12b741b3bae321fe49':
Serialize threading for download manager testing.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The download manager uses threading in a simple way -- it launches two
threads, UpdateThread and DownloadThread, and both are "fire and
forget". This is fortunate for testing, since it means we can
eliminate multithreading and simply run each thread in order, and
everything still works.
This change does just that, abstracting Thread.start() behind
SystemFacade and making FakeSystemFacade put new threads into a queue
and then run through them serially. This simplifies much of the test
code and makes it all much more predictable.
I've simplified the test code as much as possible here and moved a few
more tests over to PublicApiFunctionalTest, leaving only a minimum in
DownloadManagerFunctionalTest, which will eventually be deleted
altogether. I've also improved testing in some areas -- for example,
we can now test that running notifications get cancelled after the
download completes in a robust way.
There is one test case that checks for race conditions and requires
multithreading. I've moved this into a new ThreadingTest class, which
uses a custom FakeSystemFacade that allows multithreading. I've
extracted AbstractPublicApiTest for the newly shared code.
Change-Id: Ic1d5c76bfa9913fe053174c3d8b516790ca8b25f
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'f5373e6ba917cc60db4ee796aed8bc0e37a3f5e9'
* commit 'f5373e6ba917cc60db4ee796aed8bc0e37a3f5e9':
Stub out and test system notifications.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '93155e1da7e89d4925e244f5afa94afb8ada7381' into gingerbread-plus-aosp
* commit '93155e1da7e89d4925e244f5afa94afb8ada7381':
Stub out and test system notifications.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change abstracts NotificationManager interactions behind
SystemFacade and takes advantage of that to test notifications, to a
limited degree.
It also fixes a silly typo in AbstractDownloadManagerFunctionalTest,
and it introduces an extra sleep between tests to avoid some
flakiness. I'll look for a better solution to that problem after this
change goes in.
Change-Id: I3a0307f828955cd45b0e3581ad499da28cc0556e
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'f572f8d54340da87fcf19b4a526e6215ac1a8686'
* commit 'f572f8d54340da87fcf19b4a526e6215ac1a8686':
Test + utilize change notification in DownloadProvider
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '691fc58e9a61d99ab5018c5ddc8349ed413e4470' into gingerbread-plus-aosp
* commit '691fc58e9a61d99ab5018c5ddc8349ed413e4470':
Test + utilize change notification in DownloadProvider
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Now that I've learned how ContentResolver.notifyChange() works, add a
test to explicitly check it's being called in DownloadProvider, and
take advantage of it in waitForDownloadToStop to get rid of the ugly
old polling mechanism.
Change-Id: Iba71bdf1b0d31454cc4e186ceb4fdd9fdb5faad5
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
public API.
Merge commit '0a450da1d9e95f27f479aa45b442960baac49bb1'
* commit '0a450da1d9e95f27f479aa45b442960baac49bb1':
Support for non-purgeable downloads through the public API.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '71aab521efba9b28779541440c797220ec98ac97' into gingerbread-plus-aosp
* commit '71aab521efba9b28779541440c797220ec98ac97':
Support for non-purgeable downloads through the public API.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change adds a permission,
android.permission.DOWNLOAD_CACHE_NON_PURGEABLE. When an app has this
permission, any downloads it requests through the public API to the
download cache will automatically become non-purgeable, i.e. they'll
never be automatically deleted by the download manager to free up
space. This is intended for use only by the system updater.
Change-Id: I35cdd44f7e5d46bc70443d1a9743f61a51395ddb
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '8667ebd109ea212a7645ad6c214d4d765bb70b75'
* commit '8667ebd109ea212a7645ad6c214d4d765bb70b75':
Make DownloadProvider accessible for public API usage.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'b06b739b078ce4b00600487cfec31659647bf31f' into gingerbread-plus-aosp
* commit 'b06b739b078ce4b00600487cfec31659647bf31f':
Make DownloadProvider accessible for public API usage.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change removes the requirement that apps have the
ACCESS_DOWNLOAD_MANAGER permission in order to access
DownloadProvider. This enables the public API to work. Instead,
DownloadProvider enforces the new permissions model for the public
API:
* insert() requires INTERNET permission
* insert() checks that input fits within the restricted input allowed
for the public API
* insert() also strictly checks the file URI provided with
DESTINATION_FILE_URI (and still requires WRITE_EXTERNAL_STORAGE
permission if that is supplied)
Note that if an app has the ACCESS_DOWNLOAD_MANAGER permission, legacy
behavior is retained.
I've added a test to cover this new access, and updated the existing
permissions tests.
I also fixed a bug in WHERE clause construction in update() and
delete(), and refactored the code to eliminate duplication.
Change-Id: I53a08df137b35c2788c36350276c9dff24858af1
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit 'c2448d488ff4e476762d0a07bb0757ca99c05445'
* commit 'c2448d488ff4e476762d0a07bb0757ca99c05445':
Make COLUMN_URI readable and tighten UID restrictions.
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Merge commit '0d8d89105c00edbad95a268aaae65f2ff94ed5a1' into gingerbread-plus-aosp
* commit '0d8d89105c00edbad95a268aaae65f2ff94ed5a1':
Make COLUMN_URI readable and tighten UID restrictions.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I need to make COLUMN_URI readable by apps, since the public API
exposes that field. In order to avoid any possible security issues, I
got rid of the feature that potentially allowed apps to view downloads
from other UIDs. No one was using that feature and the public API
exposes no such feature (yet).
While at it, I cleaned up some related code in update() and delete().
Change-Id: I5384115d2a865255d009fbe37449488fd2269389
|