summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/DownloadStorageProvider.java
Commit message (Collapse)AuthorAgeFilesLines
* DownloadProvider: Add support for manual pause/resumestaging/lineage-17.0_merge-android-10.0.0_r9Zhao Wei Liew2019-12-111-3/+14
| | | | | | | | | | Implement the following features: - Manually pause/resume individual downloads in DownloadManager - Manually pause/resume all downloads in notification Based on commit ecd609e7017b8a69688bbae25c17d878ea305f19. Change-Id: I433cdee2de8b3add0248bbb0a9d02f8da4e5bb38
* Delegate deletion of mediaprovider downloads to FileSystemProvider.Sudheer Shanka2019-06-131-10/+2
| | | | | | | | | | | Using ContentResolver.delete() directly on MediaProvider doesn't work for uris corresponding to directories. For now, delegate this deletion to FileSystemProvider which will try deleting all entries regex-matching the file path. Bug: 135031305 Test: manual Change-Id: Iac18d0fd0be05758aaf2c03971d716592d96699b
* Merge "Don't use linked mediastore uris in DownloadProvider operations." ↵Sudheer Shanka2019-05-221-55/+44
|\ | | | | | | into qt-dev
| * Don't use linked mediastore uris in DownloadProvider operations.Sudheer Shanka2019-05-211-55/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When MediaProvider db gets recreated, all the media content ids get renumbered. It's possible that when DownloadProvider is trying to delete an entry, it is holding onto a invalid mediastore uri. So, don't use linked mediastore uris in DownloadProvider operations. Also, revoke any prior uri grants of media content from DownloadStorageProvider. Bug: 132087334 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 Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java Change-Id: If6fb479da7e937ecdfa23136811f3456f7bcd75c
* | Update DownloadStorageProvider for trailing '/' in RELATIVE_PATHshafik2019-05-211-2/+2
|/ | | | | | | | Add trailing '/' to RELATIVE_PATH selection args in db queries. Test: atest --test-mapping packages/providers/MediaProvider Bug:132631113 Change-Id: Ib8887dbb0e49dc76df6e4292d36e8f5948f256c5
* Allow files to be created under download dirs from MediaStore.Sudheer Shanka2019-05-131-3/+8
| | | | | | | | | | Also, allow files to be renamed if they are not in pending state and trigger a media scan when a new file is created. Bug: 127844893 Bug: 127802924 Test: manual Change-Id: Iec14c5d349930c5fae54ac3346ee5cf11fcda387
* Remove logic of including downloads dirs in pkg sandboxes.Sudheer Shanka2019-04-181-49/+29
| | | | | | Bug: 130427780 Test: manual Change-Id: I3a3c98dfa769ea6e2dac1fb3d92148489c04f3a1
* Merge "Update DownloadStorageProvider to use MediaStore.DownloadColumns." ↵Sudheer Shanka2019-04-181-54/+111
|\ | | | | | | into qt-dev
| * Update DownloadStorageProvider to use MediaStore.DownloadColumns.Sudheer Shanka2019-04-171-54/+111
| | | | | | | | | | | | | | Bug: 130232195 Test: manual Test: atest --test-mapping packages/providers/MediaProvider Change-Id: I77cd8b38c729aaaa2df138c3bc30049dba68b693
* | Exclude media files in queryRecentDocumentsIvan Chiang2019-04-161-3/+9
|/ | | | | | | | Exclude the media files when query recent files from mediastore Change-Id: If9cb87967b4cc21a7b14f1bc10e1a2349d06eb2b Fix: 130233533 Test: manual
* Remove an obsolete todo.Sudheer Shanka2019-04-121-3/+1
| | | | | | Bug: 130226648 Test: manual Change-Id: Ie38de7099d01d7d676bcaacd3951bb2aea41e90d
* Fix DownloadStorageProvider watching files in known download dirs.Sudheer Shanka2019-02-281-14/+4
| | | | | | | | | | | | | | | This change will ensure when the download root is queried for the first time, DownloadStorageProvider will start observing the existing download dirs. There is still a corner case which is not fixed by this change that is if a new sandbox top-level Download directory gets created while the user is using the files app, changes in that newly created directory won't be picked up automatically unless the user refreshes the app. Bug: 124524422 Test: manual Change-Id: I8d57eeb3f630039d217c4f0c8802c1b1b80da745
* Treat download entries with null mimeType as directories.Sudheer Shanka2019-02-211-2/+7
| | | | | | Bug: 124337318 Test: manual Change-Id: Ic0c3d2de51e07923e9d04375329ca7c84cccd88f
* Ensure DownloadStorageProvider is only reading from Files table.Sudheer Shanka2019-02-151-25/+26
| | | | | | | | | DownloadStorageProvider queries Files table, so it should only read columns available in Files table. Bug: 124504769 Test: manual Change-Id: If56e087b30229d3079b51699388f37bef887d5b2
* Fix NPE in DownloadStorageProvider.Sudheer Shanka2019-02-081-8/+5
| | | | | | Fixes: 123017716 Test: manual Change-Id: Ia2f9f57051dd8b91261e35d0bdf6d1023f4c8523
* Fix NPE in DownloadStorageProvider.Sudheer Shanka2019-01-301-2/+2
| | | | | | | | | Android/sandbox dir is not available on devices with isolated_storage flag disabled. Bug: 123613559 Test: manual Change-Id: Iaed734f9068c8089a34816936dc07ff0ff91ee03
* Allow renaming of downloads from MediaProvider.Sudheer Shanka2019-01-291-6/+42
| | | | | Test: manual Change-Id: I4f18c33cbb7521c023fabf96e78394c34301b61b
* Update DownloadStorageProvider to include MediaStore.Downloads.Sudheer Shanka2019-01-281-83/+409
| | | | | | | | | | Bug: 120879205 Test: manual 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: Ief04f55614d34ba3c8a094fbd1ede34d4fef930b
* Add new column in Root's cursor to get the supported query argsIvan Chiang2019-01-211-1/+2
| | | | | | | | | Add new column Root.COLUMN_QUERY_ARGS in Root's cursor to get the supported query args. Bug: 121234248 Test: manual Change-Id: Id1cb040927d0205dfdf5f60138a97932abb5aa19
* Don't duplicate media files in querySearchDocumentsIvan Chiang2018-12-101-8/+36
| | | | | | | | | | | When the value of DocumentsContract.QUERY_ARG_EXCLUDE_MEDIA from query bundle is true, ignore the duplicated media files. If the behavior of MediaScanner is changed, we need to add them back. Change-Id: I2322561aa7b85dc2d0418a2581446425d763b03d Fix: 119390918 Test: manual test in DocumentsUI
* Fix can't see download files in recent root in DocumentsUIIvan Chiang2018-11-281-6/+29
| | | | | | | | | | 1. Fix issue of can't see download files in recent. 2. Implement the new queryRecentDocuments method to get query limit from bundle. Change-Id: Icb9db95065d27172cd86b482dd60e2fe5390ff0c Fix: 118418471 Test: manual test in DocumentsUI
* Extend DocumentsContract search to accept mime typesIvan Chiang2018-11-141-8/+22
| | | | | | | | Implement new querySearchDocuments method Bug: 111786939 Test: Manual Test Change-Id: I154e7e3e9c059f9b18cfef64b7f6c907284d27ea
* Return underlying MIME type of download.Jeff Sharkey2018-03-271-0/+17
| | | | | | | | Only return extension-based MIME types for raw files. Test: none Bug: 73736356 Change-Id: I228916fd408cd95f1acf43817fa43ee8646cbd4e
* Remove PDF Thumbnail support from DownloadStorageProviderJulian Mancini2017-08-021-1/+1
| | | | | | | Exempt-From-Owner-Approval: Bug 63673347 Bug: 64225798 Test: Removing Functionality Change-Id: I052c2652d605101dc9df1a0b79162adb967d6250
* Give root directory a name: Downloads :)Steve McKay2017-07-271-0/+3
| | | | | | Test: Build and see name in inspector. Exempt-From-Owner-Approval: Bug 63673347 Change-Id: Ic8de6ef10bc104266fb8bbd61867e2b9788aee29
* Merge "Mark images in Downloads as supporting metadata."TreeHugger Robot2017-07-261-0/+4
|\
| * Mark images in Downloads as supporting metadata.Steve McKay2017-07-251-0/+4
| | | | | | | | | | | | | | Bug: 62621970 Test: Build and manually test. Exempt-From-Owner-Approval: Bug 63673347 Change-Id: Iebed318ba65513da10f2e152e5232c46f97c1199
* | Merge "Move the null check before assigning parentId to root doc ID."TreeHugger Robot2017-07-211-3/+5
|\ \ | |/ |/|
| * Move the null check before assigning parentId to root doc ID.Garfield Tan2017-07-211-3/+5
| | | | | | | | | | | | | | Test: Manual test. Bug: 63901648 Exempt-From-Owner-Approval: Bug 63673347 Change-Id: I28c0abbb13900567b8e6693d11b3c82055205520
* | Merge "Allow pdf thumbnail in downloads root by removing an override"Jeff Sharkey2017-07-191-8/+0
|\ \
| * | Allow pdf thumbnail in downloads root by removing an overrideJulian Mancini2017-07-191-8/+0
| |/ | | | | | | | | | | | | Bug: 63586859 Test: N/A Exempt-From-Owner-Approval: Bug 63673347 Change-Id: I9ea2c051485b2b6dd87dac4dac73dba6dbf59fd6
* / Allow DownloadStorageProvider to display PDF ThumbnailsJulian Mancini2017-07-191-1/+1
|/ | | | | | | | | | | Due to changes to FileStorageProvider (linked in Topic), DownloadStorageProvider also needed a small update so that any PDF documents have FLAG_SUPPORTS_THUMBNAIL enabled. Bug: 63586859 Test: None Exempt-From-Owner-Approval: Bug 63673347 Change-Id: Ic88640df73944b739def3ad82d3c37457e22abd7
* Add FLAG_SUPPORTS_IS_CHILD to DownloadStorageProvider.Ben Lin2017-05-251-1/+2
| | | | | | Test: DocumentsUI shows Downloads when invoked via ACTION_OPEN_TREE. Bug: 62087271 Change-Id: Ia48d912d6920b7dfcb280aadf212d34d109f31af
* Check for Downloads dir's existence and create it if it doesn't exist.Ben Lin2017-03-311-2/+5
| | | | | | | | | | | | It's possible that Downloads directory (for whatever reason) is not available on disk, and thus all sorts of bugs happen (Can't create folder/files, can't query files inside the folder). This will make sure if DownloadStorageProvider#queryRoot is called, then we will create the folder. Test: Builds. Bug: 35930004 Change-Id: I517ac20c1865f356912decd92a591a37d52ba90b
* Add findDocumentPath support to DownloadStorageProvider.Garfield Tan2017-03-161-0/+17
| | | | | Bug: 36254483 Change-Id: Ia53312cd79673ee85d0385f50e8dfef4d7ace3d4
* Add rawDocumentsUri handling to TrampolineActivity.Ben Lin2017-03-101-17/+11
| | | | | | Test: Build, compiles, does not crash. Bug: 36033829 Change-Id: I8756c6abd872e4b14cff3c604c37f82323b44c27
* Incorporating FileSystemProvider logic into DownloadStorageProvider.Ben Lin2017-02-241-89/+198
| | | | | | | | | | | | | | | This grants DownloadStorageProvider a couple of features: 1. Ability to now create folders 2. Surfacing raw file contents on disk under Shared Storage while avoiding duplicates from DownloadManager The following are kept: 1. Using DownloadManager as internal database to keep separation between raw files and user-downloaded files Test: build & smoke tested. Bug: 35157759 Change-Id: Id27e15e5bcb31ab1064ce9e3984f122754d1d5fd
* Remove support for archives from DownloadsProvider.Tomasz Mikolajewski2016-09-281-28/+0
| | | | | | Change-Id: I03d45952b63d7c4eb2e2451b81a791ec9c1ac88c Test: Compiles. Bug: 31783726
* Listen to file changes on Downloads dir.Steve McKay2016-09-061-25/+112
| | | | | | | | | | And notify clients of Downloads when files on disk. Cherrypicked from: e398c096892fe8aac0c46374aec6bbe016c41016 and 2b011b97f96463c1f4a4f6b69c5bbe18ec0fc572 (followup changes due to autocommit commiting changes before completing nits). Bug: 28430547 Change-Id: I42a42bfb5e585918fe6b384a862699445afefcbc
* Be paranoid when checking localFilePath.Steve McKay2016-08-081-1/+1
| | | | Change-Id: Ief7afa82e6ad808ed9ff80399c82eb1fdb216286
* Check that file exists in disk in queryChildDocsJorge Gil2016-08-041-2/+12
| | | | | | | | | | Check that files returned from querying DownloadManager in queryChildDocuments and queryChildDocumentsForManage still exist in External Storage. Bug: 28430547 Change-Id: I4efe9f9ba79d41b3c3099fb96d18460880b742b5
* Enable search for Downloads.Ben Lin2016-05-101-2/+24
| | | | | Bug: 26524617 Change-Id: Ide23c822b97ccab29a341184f14698dc942e8e14
* Add ability to rename a downloaded file.Ben Lin2016-04-291-1/+20
| | | | | Bug: 28359663 Change-Id: Id74ab041717f553bbd81ab2f69b1b8fa0d4d230d
* Mark incomplete downloads as partial.Steve McKay2016-03-151-1/+3
| | | | | Bug: 27526321 Change-Id: Ic29bc235242a8b87ab8321ee201cb7918594366f
* Always return FLAG_ARCHIVE for archives in DownloadProvider.Tomasz Mikolajewski2016-02-021-7/+6
| | | | | | | The logic for manage/non-manage UI is moved to DocumentsUI. Bug: 26321218 Change-Id: I1c9d24bdee493d31fe3bcea2eed877529bc1c32a
* Merge "Assign a null timestamp to active downloads."Ben Kwa2016-01-091-1/+5
|\
| * Assign a null timestamp to active downloads.Ben Kwa2016-01-081-1/+5
| | | | | | | | | | | | | | | | | | | | This makes it such that ordering downloads by timestamp doesn't continually shuffle stuff around if the UI happens to be sorting files by mod time. BUG=26417297 Change-Id: Ibe51513ee5d27ff959f8e7a2a5bad7244c3a731f
* | Request access to the filename column.Jeff Sharkey2016-01-071-0/+1
|/ | | | | | | | Otherwise it would throw at us because it's deprecated for third-party apps. Bug: 26438975 Change-Id: Ifd8f0b61ce475a009ef68ef4cb29f5f3780ced70
* Wire zip archives to Downloads.Tomasz Mikolajewski2015-12-251-6/+39
| | | | | Bug: 20176812 Change-Id: Id7b207898d5b0fb2013d07e2da3302b09e4995fe
* Sanitize display names, keep extensions intact.Ben Kwa2015-04-221-8/+4
| | | | | | | | | | Use the newly factored FileUtils sanitize the requested display names to be valid FAT filenames, and also allow any extension that maps to the requested MIME type. BUG=20157955 Change-Id: Ic37863a3362a941d81632bd4a7562dae40053652