summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* RESTRICT AUTOMERGE Enable stricter SQLiteQueryBuilder options.Jeff Sharkey2019-09-102-342/+107
| | | | | | | | | | | | | | | | | | | | | | | Malicious callers can leak side-channel information by using subqueries in any untrusted inputs where SQLite allows "expr" values. This change starts using setStrictColumns() and setStrictGrammar() on SQLiteQueryBuilder to block this class of attacks. This means we now need to define the projection mapping of valid columns, which consists of both the columns defined in the public API and columns read internally by DownloadInfo.Reader. We're okay growing sAppReadableColumnsSet like this, since we're relying on our trusted WHERE clause to filter away any rows that don't belong to the calling UID. Remove the legacy Lexer code, since we're now internally relying on the robust and well-tested SQLiteTokenizer logic. Bug: 135270103, 135269143 Test: atest DownloadProviderTests Test: atest CtsAppTestCases:android.app.cts.DownloadManagerTest Change-Id: I8e595e1470df586a3d593b7851305da413e44347
* Merge "Trigger mediascan after a download is completed." into qt-devbsears2019-08-012-0/+11
|\
| * Trigger mediascan after a download is completed.Sudheer Shanka2019-07-312-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Set FGS priority for download jobs with visible notifications.Sudheer Shanka2019-07-032-1/+2
|/ | | | | | | | | | | | | | | | | | | | This is what DownloadProvider used to do pre-Q using PRIORITY_FOREGROUND_APP but in Q, we added a new priority to denote FGS but DownloadProvider was still using PRIORITY_FOREGROUND_APP which is now considered a lower priority than FGS and some jobs are getting preempted unnecessarily. So, update DownloadProvider to mark download jobs with FGS priority instead of BFGS priority. This still has some issues but at least this will be kind of reverting DownloadProvider to its pre-Q behavior. Bug: 135982638 Test: manual - Go through DO provisioning a few times and check admin app can be successfully downloaded. 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: I020e366845d768da271b860a7ace91318e67d8ae
* Import translations. DO NOT MERGEBill Yi2019-06-253-5/+5
| | | | | | | Auto-generated-cl: translation import Bug: 64712476 Change-Id: Ide5c53d86bdaa894b17f6820fa3ebf7dc34db424
* Whitelist DownloadManager.ACTION_NOTIFICATION_CLICKED broadcastMichal Karpinski2019-06-186-1/+34
| | | | | | | | | | | | | 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
* Merge "Delegate deletion of mediaprovider downloads to FileSystemProvider." ↵Sudheer Shanka2019-06-141-10/+2
|\ | | | | | | into qt-dev
| * 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
* | [automerger skipped] Import translations. DO NOT MERGEBill Yi2019-06-140-0/+0
|\ \ | |/ |/| | | | | | | | | am: 00cced240d -s ours am skip reason: subject contains skip directive Change-Id: I43d16ab9ca453633ff0aefd1b226c7b62a067052
| * Import translations. DO NOT MERGEBill Yi2019-06-1320-41/+41
| | | | | | | | | | | | | | Auto-generated-cl: translation import Bug: 64712476 Change-Id: I7e105e0b1484a04abdba3f72bcc140ff6f3480e3
* | Import translations. DO NOT MERGEBill Yi2019-06-082-2/+2
| | | | | | | | | | | | | | Auto-generated-cl: translation import Bug: 64712476 Change-Id: Iee77bf7755e593379fa2b004d916fcb71aa9b3c0
* | Merge "Delete entries of uninstalled pkgs which haven't started ↵TreeHugger Robot2019-05-291-1/+4
|\ \ | | | | | | | | | downloading." into qt-dev
| * | Delete entries of uninstalled pkgs which haven't started downloading.Sudheer Shanka2019-05-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 133741222 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: I00796e5ff8e9b30d153490f997fb7c776b600e57
* | | Import translations. DO NOT MERGEBill Yi2019-05-247-8/+8
|/ / | | | | | | | | | | | | Auto-generated-cl: translation import Bug: 64712476 Change-Id: If8e7af64199b4c977195c4ee66919aa9045580b0
* | Merge "Don't use linked mediastore uris in DownloadProvider operations." ↵Sudheer Shanka2019-05-222-188/+78
|\ \ | | | | | | | | | into qt-dev
| * | Don't use linked mediastore uris in DownloadProvider operations.Sudheer Shanka2019-05-212-188/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Update behavior of setDestinationInExternalPublicDir().Sudheer Shanka2019-05-094-106/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Don't log when checking if a filepath belongs to certain dirs." into ↵Sudheer Shanka2019-05-072-4/+6
|\ \ | | | | | | | | | qt-dev
| * | Don't log when checking if a filepath belongs to certain dirs.Sudheer Shanka2019-05-062-4/+6
| | | | | | | | | | | | | | | | | | Bug: 131693243 Test: n/a Change-Id: Iae700a00f1bca78f823a3f8b732d86d380942828
* | | Merge "Fix DownloadProviderTests." into qt-devSudheer Shanka2019-05-062-3/+11
|\ \ \
| * | | Fix DownloadProviderTests.Sudheer Shanka2019-05-012-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 131693243 Test: atest DownloadProviderTests Change-Id: Iefdd7690e45351c2dbdac1cff49f0d11aeba0fb0
* | | | Import translations. DO NOT MERGEBill Yi2019-05-034-14/+14
| |/ / |/| | | | | | | | | | | | | | | | | Auto-generated-cl: translation import Bug: 64712476 Change-Id: I6c763081dde011763dae9f978a9f8a61abc4f0cf
* | | Merge "Update API impl of ↵TreeHugger Robot2019-05-013-8/+66
|\| | | | | | | | | | | allowScanningByMediaScanner/setVisibleInDownloadsUi." into qt-dev
| * | Update API impl of allowScanningByMediaScanner/setVisibleInDownloadsUi.Sudheer Shanka2019-04-303-8/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Skip restrictions if DownloadProvider itself is trying to add a ↵Sudheer Shanka2019-04-301-1/+3
|\ \ \ | |/ / |/| | | | | download." into qt-dev
| * | Skip restrictions if DownloadProvider itself is trying to add a download.Sudheer Shanka2019-04-301-1/+3
| | | | | | | | | | | | | | | | | | | | | Fixes: 131624566 Fixes: 131610977 Test: manual Change-Id: I771ff8a39ac977c510f1785c3cb61e859bbb0c0f
* | | Make downloads deletion on owner uninstall consistent.Sudheer Shanka2019-04-283-24/+98
|/ / | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Import translations. DO NOT MERGE" into qt-devTreeHugger Robot2019-04-253-4/+4
|\ \
| * | Import translations. DO NOT MERGEBill Yi2019-04-243-4/+4
| | | | | | | | | | | | | | | | | | | | | Auto-generated-cl: translation import Bug: 64712476 Change-Id: Ie89705d17abb8825621dd7213ced155259f81367
* | | Update behavior of some DownloadManager APIs.Sudheer Shanka2019-04-232-130/+194
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- Update behavior of DownloadManager.setDestinationUri(), DownloadManager.setDestinationInExternalPublicDir() and DownloadManager.addCompletedDownload() based on the latest storage re-design. Essentially, going forward these APIs will only allow downloading files into package owned dirs or the top-level Download dir. -- Allow some system components to specify MediaColumns.OWNER_PACKAGE_NAME when inserting items into MediaProvider. -- Don't copy DownloadManager.COLUMN_TITLE to MediaProvider. DownloadProvider and MediaProvider have different constraints around "title" and there isn't really a need to keep these in sync. -- Sanity check file download paths hinted by apps. -- Remove sandbox related logic in DownloadProvider. Bug: 120879208 Bug: 128630262 Bug: 130797842 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/tests/tests/provider/src/android/provider/cts/MediaStore* Change-Id: I8f4569f91f2c0567ff892a2107183cd11b7065a7
* | 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-182-55/+112
|\ \ | | | | | | | | | into qt-dev
| * | Update DownloadStorageProvider to use MediaStore.DownloadColumns.Sudheer Shanka2019-04-172-55/+112
| | | | | | | | | | | | | | | | | | | | | Bug: 130232195 Test: manual Test: atest --test-mapping packages/providers/MediaProvider Change-Id: I77cd8b38c729aaaa2df138c3bc30049dba68b693
* | | Merge "Fix issue of downloaded apks not getting installed." into qt-devSudheer Shanka2019-04-181-0/+1
|\ \ \
| * | | Fix issue of downloaded apks not getting installed.Sudheer Shanka2019-04-171-0/+1
| |/ / | | | | | | | | | | | | | | | Fixes: 130759236 Test: manual Change-Id: I8791cd3261f6a0f85cb5bc0e6d13a656fa7b1e8b
* | | Merge "Exclude media files in queryRecentDocuments" into qt-devIvan Chiang2019-04-181-3/+9
|\ \ \
| * | | 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
* / / Import translations. DO NOT MERGEBill Yi2019-04-177-9/+9
|/ / | | | | | | | | | | | | Auto-generated-cl: translation import Bug: 64712476 Change-Id: I8b610ec35d9d786bf2594130cf574e25cc014d82
* | Remove an obsolete todo.Sudheer Shanka2019-04-121-3/+1
| | | | | | | | | | | | Bug: 130226648 Test: manual Change-Id: Ie38de7099d01d7d676bcaacd3951bb2aea41e90d
* | Fix the atest can't start with single testFelka Chang2019-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the developer want to start single test by using "atest package:class_name#method_name" but doesn't work. To replace InstrumentationTest with AndroidJunitTest in Android.bp. Bug: 129309239 Test: TID="DownloadProviderTests"; \ PACKAGE_NAME="com.android.providers.downloads"; \ TEST_CLASS="DownloadProviderFunctionalTest"; \ TEST_METHOD="testDownloadToCache"; \ atest "${TID}:${PACKAGE_NAME}.${TEST_CLASS}#${TEST_METHOD}" Change-Id: If592035777f7cc69a4a2e20aebf77867251774c8
* | Import translations. DO NOT MERGEBill Yi2019-03-231-1/+1
| | | | | | | | | | Change-Id: Ia3613fb516c796c876810a15e875fb94ae96ea66 Auto-generated-cl: translation import
* | Don't canonicalize app paths in system.Jeff Sharkey2019-03-131-8/+4
| | | | | | | | | | | | | | | | | | The provider isn't in the requesting app's sandbox, so it's unlikely that we can canonicalize the path. Bug: 128383017 Test: none Change-Id: I689ebb44e4c5d7f579ec998ff7333ee9b8d46542
* | Merge "Canonicalize filepaths before saving to db."Sudheer Shanka2019-03-042-10/+32
|\ \
| * | Canonicalize filepaths before saving to db.Sudheer Shanka2019-03-022-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 126888145 Bug: 122475235 Test: atest DownloadProviderTests Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java Change-Id: I96fa73d3a18e94986043c45dc4e12a47d62eeea6
* | | 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
* | Merge stage-aosp-master into pi-dev-plus-aospXin Li2019-02-250-0/+0
|\ \ | | | | | | | | | | | | | | | am: 9ca91b564d Change-Id: Ib5674e02e7b6a6fe8b739b0c8491c9ec1bcca00a
| * \ Merge stage-aosp-master into pi-dev-plus-aospXin Li2019-02-250-0/+0
| |\ \ | | | | | | | | | | | | | | | | Bug: 126125118 Change-Id: I4847a79a4fe15274ca313e5697d6947d6aaa7116
| | * \ DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-masterXin Li2019-02-2111-35/+35
| | |\ \ | | | | | | | | | | | | | | | | | | | | Bug: 120848293 Change-Id: Id5b93505f0e715fa4b0ee732ae63730cc38f7c3b