History log of /packages/providers/DownloadProvider/src/com/android/providers/downloads/StorageUtils.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4e8835ce6539fae293aae96299b63397b0ac374d 07-Jun-2016 Ian Rogers <irogers@google.com> Fix broken sort order.

Int conversion may invert the sign of a long making it unsuitable for use in
comparators.
Caught by Error Prone.
Bug: 27723540

Change-Id: I030539d7f5e6a1652df71a815a47c46089cae6a2
/packages/providers/DownloadProvider/src/com/android/providers/downloads/StorageUtils.java
ed30deae5fe5b9de142b44933001c9b098c47712 13-Jul-2015 Jeff Sharkey <jsharkey@android.com> Relax permissions on package-specific paths.

Normally apps must hold the WRITE_EXTERNAL_STORAGE permission in
order to use DownloadManager. However, now that the platform has
relaxed permissions on package-specific directories, we relax the
DownloadManager check in a similar way. This also opens up using
DownloadManager to save files on secondary external storage devices.

Fix bug so that we now check the relevant volume state when thinking
about resuming a download.

Bug: 22135060
Change-Id: If439340ea48789ea167f49709b5b69a4f0883150
/packages/providers/DownloadProvider/src/com/android/providers/downloads/StorageUtils.java
5dcbf701c9077e62ca8c1ee0079b4cbffaf57d14 29-Apr-2014 Elliott Hughes <enh@google.com> Move internal DownloadProvider code off libcore.os.

(As much as possible. There are no plans to make the mocking API public.)

Change-Id: I348877b850d6d34572d5a19e67952254bc4f12ef
/packages/providers/DownloadProvider/src/com/android/providers/downloads/StorageUtils.java
1f2c2c560400ba60c5b9dfd6fd4f5e73b232803a 07-Feb-2014 Jeff Sharkey <jsharkey@android.com> Add idle service to clean orphan downloads.

Periodically reconcile database against disk contents. This handles
the case where a user/app deletes files directly from disk without
updating the database, and the rare case where a database delete
didn't make it to deleting the underlying file.

Also cleans up any downloads belonging to a UID when removed.

Bug: 12924143
Change-Id: I4899d09df7ef71f2625491ac01ceeafa8a2013ce
/packages/providers/DownloadProvider/src/com/android/providers/downloads/StorageUtils.java
dffbb9c4567e9d29d19964a83129e38dceab7055 31-Jan-2014 Jeff Sharkey <jsharkey@android.com> Many improvements to download storage management.

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
/packages/providers/DownloadProvider/src/com/android/providers/downloads/StorageUtils.java