| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a media item is inserted, media_type will be
automatically updated but some of the other media
attributes will only be updated after a media scan.
Bug: 138419471
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: If8192b31fb7da37425480e7afa53dd1304533b76
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for background activity starts
When the DownloadManager download notification is clicked,
that broadcast is sent to an app, and the app should be able
to open activities from bg for its duration.
Bug: 135515407
Test: com.android.providers.downloads.PublicApiFunctionalTest#testNotificationClickedBroadcast
Test: manual
Change-Id: Ic1691f5bda890ceb2938ac76f4ca2a4c7e7a1160
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow apps to use DownloadManager for downloading files into
known public dirs other than "Download" but don't include
them as part of Downloads collection.
Bug: 132136431
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: I62d4f810c71c9231e2b6d8e276a0a1e326382e14
|
|
|
|
|
|
| |
Bug: 131693243
Test: atest DownloadProviderTests
Change-Id: Iefdd7690e45351c2dbdac1cff49f0d11aeba0fb0
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These APIs javadocs have been updated earlier to indicate how they behave
on Q, now updating impl of those APIs to match with javadocs.
Bug: 131693243
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Change-Id: I8fb43806b27fefaffc510fde5424b48e3ff56d20
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an app is uninstalled, it's downloads in top-level
download directory will be orphaned and the rest will be
deleted.
Bug: 126064843
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Change-Id: Iad430f7ec14f306ed859a3b30db9eea29a23c19d
|
|
|
|
|
|
|
|
|
| |
Bug: 126888145
Bug: 122475235
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Change-Id: I96fa73d3a18e94986043c45dc4e12a47d62eeea6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Files downloaded using DownloadManager or those added to
DownloadProvider using DownloadManager.addCompletedDownload() API
are added to MediaStore Downloads collection so that apps can
query all their downloads using MediaStore collection APIs.
Bug: 120876251
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest MediaProviderTests
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Icaff9b013bb9486651ce0b5631cc48e80cdbb4b9
|
|\
| |
| |
| |
| |
| | |
am: 991e53c2df
Change-Id: Ic0366d2492e941cebd44c83e167c7876a0892bdc
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Start using ArrayUtils.throwsIfOutOfBounds instead. The Arrays method
is going to be removed.
Bug: 78447530
Test: tradefed.sh run commandAndExit template/local_min --template:map test=DownloadProviderTests
Change-Id: I973f0b145d1dfd98b43ba429393b2324122ba374
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously DownloadManager only respected the manifest attribute, this
change makes DownloadManager handle both the manifest and the network
security config
Change-Id: I5666a1eea6278acc3864620a0e5a4c3ae37635b8
Fixes: 78028215
Test: atest CtsNetSecConfigDownloadManagerTestCases
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Checking new capability is perferred way to verify a network isn't
roaming; isRoaming() is now deprecated.
Test: bit DownloadProviderTests:*
Bug: 68397798
Change-Id: I11d19fd5a389b52e199c604a6906423d405072e2
|
|/
|
|
|
|
|
|
|
|
|
|
| |
On devices with multiple active networks, or rapidly switching
between networks, we need an API to tell jobs explicitly which
network to use. (For example, the default route could meet all
job criteria, but we could have changed the default network by the
time we spun up the JobService.)
Test: verified via DownloadManager
Bug: 64133169
Change-Id: I9c131818d7199f79e147893d85c281473d00bee9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of reaching directly into PackageManager, use the new
StorageManager API to allocate disk space for downloads. This wraps
both clearing cached files and fallocate() into a single method.
Remove support for storing downloads on the /cache partition, which
doesn't exist on many devices.
Bug: 63057877
Test: bit DownloadProviderTests:*
Exempt-From-Owner-Approval: Bug 63673347
Change-Id: I5749f7a2f7ded9157fea763dc652bf4da88d86ff
|
|
|
|
|
|
|
|
|
|
| |
The OS now completely relies on NET_CAPABILITY_NOT_METERED to avoid
confusion and staleness.
Bug: 63391323
Test: builds, boots, Wi-Fi policy is upgraded
Exempt-From-Owner-Approval: Bug 63673347
Change-Id: Iea83e0afd8cbd2be10d85b8a35c903047716b5b9
|
|\
| |
| |
| |
| |
| |
| |
| | |
473ee1358d am: 3799056e04
am: f2283c55d4
Change-Id: I4368376fe6f963c44e179df93ea6124a82d3954f
|
| |
| |
| |
| |
| | |
Bug:29505888
Change-Id: Ifc33fd75e44d1dbc5a4ce5caa8e1ff938b94623e
|
|/
|
|
|
| |
Bug: 26524617
Change-Id: Ide23c822b97ccab29a341184f14698dc942e8e14
|
|
|
|
|
|
|
|
|
|
|
| |
Downloads with visible notifications should behave as if the
requesting app was running a foreground service. The easiest way
to implement this for now is to ignore any BLOCKED network status
and use the new setWillBeForeground() API so job scheduling ignores
any active blocked/dozing status.
Bug: 26571724
Change-Id: I8ea2b2a7cdb5f469adc11b4d897ff55bd8a9db9a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Use parseInt when the result is assigned to an int. Allocates fewer
objects.
bug: 28078871
Change-Id: I2c58112795fecce6395c558f2bb1e1fefe83a5bf
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Downloads should use the default network for the caller. This prevents
applications from, for example, bypassing VPN by routing all requests
through the DownloadProvider.
Bug: 27074270
Change-Id: I7830226dd2910757d3a5c78f373330f84637ccfa
|
|/
|
|
| |
Change-Id: I9b2711c2a9b3edd4bbef97ff6cdcae9fdc9ef433
|
|
|
|
|
| |
Bug: 22958127
Change-Id: I314a9bdd21988bf7e6cc79a2ae842bed29c96f17
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the Provider-side of the DownloadManager framework honor
the per-UID cleartext network traffic policy. The policy is enforced
in the Provider rather than in its client (DownloadManager) because
download URLs could get redirected between HTTPS and HTTP and only
the Provider currently has visibility into and control over this.
Whether cleartext network traffic is permitted is a per-package
policy. However, the DownloadProvider can only access the UID of the
requesting application. Multiple packages can run under the same UID.
In that scenario, cleartext traffic is permited for the UID if
cleartext traffic is permitted for any of the packages running under
the UID. This could be improved by making the DownloadManager provide
the package name in addition to the UID.
Bug: 19215516
Change-Id: Ib37585a7a2fc2869954d52a1b08052926f49bc9b
|
|
|
|
|
|
|
| |
Bug: 18083851
(cherry pick from commit f1cd37d8bade42be0632f54dcd61f81711269606)
Change-Id: I93f14e171abc7a52fe2117c8503374734147513b
|
|
|
|
|
|
| |
(As much as possible. There are no plans to make the mocking API public.)
Change-Id: I348877b850d6d34572d5a19e67952254bc4f12ef
|
|
|
|
|
|
|
| |
StructStatVfs and ErrnoException were moved from libcore.io to
android.system
Change-Id: I42c789a941f964ae7dde224b16af39a95212fbc7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Icaba016bc6e098745e56a3b6367a8a6af0151158
|
|
|
|
| |
Change-Id: Ida4a0a85883ccd6763b07e958ddc6ecf7eedf790
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When multiple downloads are running in parallel, they can end up
claiming the same filename and clobber over each other. This change
introduces locking around filename generation, and touches the
claimed filename so other threads fail the File.exists() check and
keep looking.
Tests to verify.
Bug: 8255596
Change-Id: Ie75ed047c199cf679832c75159056ca036eac18d
|
|
|
|
|
|
|
|
| |
Streams a 3GB file to verify that it downloads correctly, using new
MockWebServer streaming API.
Bug: 8209169
Change-Id: Ic36271bfef3176e1ccea2b40edc7abb1044222f1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the service lifecycle was managed through a large for()
loop which was extremely tricky to reason about. This resulted in
several race conditions that could leave the service running
indefinitely, or terminate it early before tasks had finished.
This change redesigns the update loop to be event driven based on
database updates, and to collapse mutiple pending update passes. It
is much easier to reason about service termination conditions, and
it correctly uses startId to handle races during command delivery.
Also moves scanner into isolated class, and switches to using public
API instead of binding to private interface.
Bug: 7638470, 7455406, 7162341
Change-Id: I380e77f5432223b2acb4e819e37f29f98ee4782b
|
|
|
|
| |
Change-Id: Ice24d5c62bbcbcfd3d7374eac3a20580f7f31f36
|
|
|
|
|
|
|
|
|
|
| |
Verify that servers responding with many retries or redirects result
in failed download, instead of spinning out of control. Test to
verify that changed ETag results in download failing.
Also fix handling of HTTP 301 to update Uri in database.
Change-Id: Iff2948d79961a245b7900117d107edaa356618c9
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Move redirection handling into a single loop, and handle each HTTP
response code inline to make flow control easier to reason about.
Fix race condition in tests by waiting for first status update.
Bug: 7887226
Change-Id: Id4bfd182941baad4cd0bb702376c4beeb7275bb2
|
|
|
|
|
|
|
|
|
|
|
| |
Change runUntilStatus() methods to polling with timeout instead of
requiring internal knowledge about threading.
Fix notification tests, and move opening of InputStream until after
handling headers to avoid FNFE. Always reset facade to defaults
before each test.
Change-Id: I6b2d6cfc4e685d2090c1133b1b2e89ae12760f8b
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix bug where resumed downloads wouldn't open in append mode. Handle
end of stream exceptions from URLConnection as special-case for now
to keep tests passing.
Move stream creation outside of DrmOutputStream, and always fsync()
before closing files. Treat HTTP header errors as retryable. Add
explicit state checks to redirection tests.
Change-Id: I19d007284f6bfbffaac93859fe47cd98b79a59c4
|
|
|
|
|
|
|
|
|
|
| |
Calculate speed of in-progress downloads and estimate time remaining
until completion. Uses a moving average that is weighted 1:1 with
the most recent 500ms sample. Funnels timing data to notifications
through DownloadHandler.
Bug: 6777872
Change-Id: I9155f2979aa330bd1172f63bbfca1d053815cee5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switch to using new inbox-style notifications when collapsing multiple
downloads. Correctly handles clustering, including cancellation of
stale notifications. All notifications are now handled in a single
class, making it easier to reason about correctness.
Fixed bugs around handling of visibility flags. Move away from using
"int" as internal keys, since they can overflow. Started work for
time estimates, will finish in a future CL.
Explicitly pass all relevant IDs to DownloadReceiver instead of doing
a second racy query. Fix StrictMode warnings when querying in
DownloadReceiver.
Bug: 6777872, 5463678, 6663547, 6967346, 6634261, 5608365
Change-Id: I5eb47b73b90b6250acec2ce5bf8d7a274ed9d3a9
|
|
|
|
|
|
| |
Directly mock NotificationManager instead of using SystemFacade.
Change-Id: If932d26e23816e8674469c275a828701cce5fc2d
|
|
|
|
|
|
|
|
|
|
|
|
| |
Include flag with each download to indicate if its allowed to proceed
over metered networks. Downloads are left in WAITING_FOR_NETWORK
state, similar to how ALLOWED_NETWORK_TYPES is handled.
Also keep blocked downloads in WAITING_FOR_NETWORK state instead
of marking them as failed.
Bug: 3001465, 5734560
Change-Id: I80bb9aa9bd25ddf6f7a2472db344b6ba6878bd74
|
|
|
|
|
| |
Bug: 4726601
Change-Id: Ibe537bd5c2a092dbf974360cd454751881f7f4ea
|
|
|
|
| |
Change-Id: Idfd4da891a6709504ea4f0cc72701400f63e0c2d
|
|
|
|
|
|
|
|
|
|
|
| |
Now network access is determined by using getActiveNetworkInfoForUid()
which uses BLOCKED to indicate that network should be rejected for
the requesting UID. While download in progress, watch for any policy
changes that should trigger pause.
Also check NetworkInfo.isConnected() for correctness.
Change-Id: I1efa79823f15ecc3fa088a6719da1b770c64b255
|
|
|
|
| |
Change-Id: Ibbce0782fcf7649209d6f56be240209cebd9045b
|