summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '40238b9a601d58d2b4f88da7b14823e8c0340bc6' into ↵Jeff Sharkey2016-09-161-0/+44
|\ | | | | | | | | | | | | | | manual_merge_40238b9 am: 1d0dcb200d Change-Id: I78915dfdf001a8d1ea15f0d6cfee769ec81d5296
| * Merge commit '40238b9a601d58d2b4f88da7b14823e8c0340bc6' into ↵Jeff Sharkey2016-09-161-0/+44
| |\ | | | | | | | | | | | | | | | manual_merge_40238b9 Change-Id: I0d8441c4bae392726e7d41c77b1d9ac5eda1c09c
| | * Enforce calling identity before clearing. am: 7c1af8c62c am: 47dcd095ea am: ↵Jeff Sharkey2016-09-161-0/+44
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 51033d49f6 am: 9bbd21ff0c am: 0bd9e49a06 am: 73721ade0d am: 36b9c38a53 Change-Id: I53525f314f5ebc659e26c972c62517833ea03e19
| | | * Enforce calling identity before clearing. am: 7c1af8c62c am: 47dcd095ea am: ↵Jeff Sharkey2016-09-161-0/+44
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 51033d49f6 am: 9bbd21ff0c Change-Id: I5f09670f0629addb5fa847799184716020234f35
| | | | * Enforce calling identity before clearing. am: 7c1af8c62c am: 47dcd095eaJeff Sharkey2016-09-161-0/+44
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 51033d49f6 Change-Id: Ic319b5f1f9351a83a2fde49aedc99f996fda8ef5
| | | | | * Enforce calling identity before clearing.Jeff Sharkey2016-09-161-0/+44
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 7c1af8c62c Change-Id: Id435bda5c939ab48c3e1fb69f13292a4740828d4
| | | | | | * Enforce calling identity before clearing.Jeff Sharkey2016-09-161-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When opening a downloaded file, enforce that the caller can actually see the requested download before clearing their identity to read internal columns. However, this means that we can no longer return the "my_downloads" paths: if those Uris were shared beyond the app that requested the download, access would be denied. Instead, we need to switch to using "all_downloads" Uris so that permission grants can be issued to third-party viewer apps. Since an app requesting a download doesn't normally have permission to "all_downloads" paths, we issue narrow grants toward the owner of each download, both at device boot and when new downloads are started. Bug: 30537115, 30945409 Change-Id: If944aada020878a91c363963728d0da9f6fae3ea
* | | | | | | DO NOT MERGE: Check that file exists in disk in queryChildDocsJorge Gil2016-08-291-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check that files returned from querying DownloadManager in queryChildDocuments and queryChildDocumentsForManage still exist in External Storage. Bug: 28430547, 31108493 Change-Id: I4efe9f9ba79d41b3c3099fb96d18460880b742b5 (cherry picked from commit c45f4998c0b4f7ab44d3d2a180ca977ca2fa5ca8) (cherry picked from commit 314026d4e85d0d1d075d5de83038cec1e751ec64)
* | | | | | | Revert "Enforce calling identity before clearing." am: b440ceb00f am: ↵Adam Seaton2016-08-261-13/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6777320335 am: a474af3a08 am: 8bec536bf2 am: 34ccbd80ea am: 956426bee5 am: 6a6944d1f4 am: 8e8770bdc8 am: 85a6e20a85 Change-Id: I22493ee28ab8129b93eca671bb17c28cf8c4e830
| * | | | | | Revert "Enforce calling identity before clearing." am: b440ceb00f am: ↵Adam Seaton2016-08-261-13/+0
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6777320335 am: a474af3a08 am: 8bec536bf2 am: 34ccbd80ea am: 956426bee5 am: 6a6944d1f4 am: 8e8770bdc8 Change-Id: I208036cd66780728f627cd11b2514eeb03c74800
| | * | | | | Revert "Enforce calling identity before clearing." am: b440ceb00f am: ↵Adam Seaton2016-08-261-13/+0
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6777320335 am: a474af3a08 am: 8bec536bf2 am: 34ccbd80ea am: 956426bee5 am: 6a6944d1f4 Change-Id: Ib01cab89347d96c44478e51a27ef2cf17e1e7b2d
| | | * | | | Revert "Enforce calling identity before clearing." am: b440ceb00f am: ↵Adam Seaton2016-08-261-13/+0
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6777320335 am: a474af3a08 am: 8bec536bf2 Change-Id: I81ea34a6f1cdaa438af6397651d7374628d44eff
| | | | * | | Revert "Enforce calling identity before clearing." am: b440ceb00f am: 6777320335Adam Seaton2016-08-261-13/+0
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: a474af3a08 Change-Id: I133dc7915c5dfd0e2d70ece76c008c7b282f0bcb
| | | | | * | Revert "Enforce calling identity before clearing."Adam Seaton2016-08-261-13/+0
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: b440ceb00f Change-Id: If9feec471d71fbfa05a4cf9a8633142c724b6da3
| | | | | | * Revert "Enforce calling identity before clearing."Adam Seaton2016-08-261-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8be3a92eb0b4105a9ed748be5a937ce79145f565. Change-Id: I10401d57239b868f8e3514f81a0e20486838e29c
* | | | | | | Enforce calling identity before clearing. am: 8be3a92eb0 am: ec19fe6485 am: ↵Jeff Sharkey2016-08-091-0/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b3ce7976f2 am: 860239d87e am: 616f47abce am: a9ea617232 am: 567e549614 am: 14ae5650e4 am: 80ab64c562 Change-Id: I8ef0c4042a97682885897dc23c7a676d4d746ca6
| * | | | | | Enforce calling identity before clearing. am: 8be3a92eb0 am: ec19fe6485 am: ↵Jeff Sharkey2016-08-091-0/+13
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b3ce7976f2 am: 860239d87e am: 616f47abce am: a9ea617232 am: 567e549614 am: 14ae5650e4 Change-Id: I3688aa1ad8e48901b321823f03636bbd55d76780
| | * | | | | Enforce calling identity before clearing. am: 8be3a92eb0 am: ec19fe6485 am: ↵Jeff Sharkey2016-08-091-0/+13
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b3ce7976f2 am: 860239d87e am: 616f47abce am: a9ea617232 am: 567e549614 Change-Id: I47ae3c7cfa1e3f6239d95697cf641c8d498a4e60
| | | * | | | Enforce calling identity before clearing. am: 8be3a92eb0 am: ec19fe6485 am: ↵Jeff Sharkey2016-08-091-0/+13
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b3ce7976f2 am: 860239d87e Change-Id: Ic62206ad61c81da00eb57679211c140ce7053032
| | | | * | | Enforce calling identity before clearing. am: 8be3a92eb0 am: ec19fe6485Jeff Sharkey2016-08-091-0/+13
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: b3ce7976f2 Change-Id: I539882f08289cabaaf49326fb7973d98d0323de2
| | | | | * | Enforce calling identity before clearing.Jeff Sharkey2016-08-091-0/+13
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 8be3a92eb0 Change-Id: I0b339abd106680e44a7e900e3eae514cf0f630c1
| | | | | | * Enforce calling identity before clearing.Jeff Sharkey2016-08-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When opening a downloaded file, enforce that the caller can actually see the requested download before clearing their identity to read internal columns. Bug: 30537115 Change-Id: I01bbad7997e5e908bfb19f5d576860a24f59f295
| | | | | | * Use resolved path for both checking and opening.Jeff Sharkey2016-01-142-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids a race condition where someone can change a symlink target after the security checks have passed. Bug: 26211054 Change-Id: I5842aaecc7b7d417a3b1902957b59b8a1f3c1ccb
| | | | * | | Use resolved path for both checking and opening. am: bdc831357eJeff Sharkey2016-01-152-3/+8
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 0e710ca30d * commit '0e710ca30d0b04843b3d2e83755e35fe092cfd4a': Use resolved path for both checking and opening.
| | | | | * | Use resolved path for both checking and opening.Jeff Sharkey2016-01-142-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids a race condition where someone can change a symlink target after the security checks have passed. Bug: 26211054 Change-Id: I5842aaecc7b7d417a3b1902957b59b8a1f3c1ccb
| | | * | | | DO NOT MERGE. Use resolved path when inserting and deleting.Jeff Sharkey2016-02-161-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids a race condition where someone can change a symlink target after the security checks have passed. Bug: 26211054 Change-Id: I40ed6d2298e4b66b4f7a055e68d9820515adf351
| | | * | | | Use resolved path for both checking and opening.Jeff Sharkey2016-01-142-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids a race condition where someone can change a symlink target after the security checks have passed. Bug: 26211054 Change-Id: I5842aaecc7b7d417a3b1902957b59b8a1f3c1ccb
| | * | | | | Merge "DO NOT MERGE. Use resolved path when inserting and deleting." into ↵Jeff Sharkey2016-02-181-5/+15
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | mnc-dr1.5-dev
| | | * | | | | DO NOT MERGE. Use resolved path when inserting and deleting.Jeff Sharkey2016-02-161-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids a race condition where someone can change a symlink target after the security checks have passed. Bug: 26211054 Change-Id: I03b06b746fde5d08d6b61a7011bdace0b4e9fa77
* | | | | | | | Waiting for Wi-Fi notification is not ongoing.Jeff Sharkey2016-07-281-1/+3
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only active downloads should be classified as ongoing notifications. Bug: 30065873 Change-Id: I778eafb0737c7da17216fb3012847e6a3beccde9
* | | | | | | Clear identity when deleting scanned entry.Jeff Sharkey2016-06-281-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When deleting a file from DownloadManager, we also reach over and clean up any scanned MediaStore entries. However, DownloadManager clients may not hold the WRITE_EXTERNAL_STORAGE permission, such as when they downloaded a file into their package-specific directories. The safest fix for now is to clear the calling identity and always clean up the MediaStore entries ourselves, since DownloadProvider always holds the required storage permission. Bug: 29777504 Change-Id: Iea8f5696410010807b118bb56e5b897c53f0e1fe
* | | | | | | Make scanning decisions based on latest data.Jeff Sharkey2016-06-252-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When deciding to kick off a media scan of a newly-downloaded file, use the latest values from InfoDelta, instead of stale values from the last database read, which may lead us to skip the scan. Bug: 29234780 Change-Id: I7ffbcdd1edb9965999b7f5f100f57a9c2933f3a5
* | | | | | | Re-schedule downloads queued for unmetered.Jeff Sharkey2016-06-222-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a download is stopped due to a metered network, we should reschedule the job just like any other network failure. If a download requires an unmetered network, treat WAITING_FOR_NETWORK as QUEUED_FOR_WIFI so we show a meaningful notification. Bug: 29440531 Change-Id: I31e6535c575fd32e2982ef840ae501acf1db3927
* | | | | | | Update notifications when no jobs are scheduled.Jeff Sharkey2016-06-221-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When inserting an already-completed download, we don't schedule a job, leaving notifications stale until the next real download comes along. This change kicks off a notification update pass in these cases to ensure we reflect the internal state. Bug: 29548026 Change-Id: I6ff87d69d83c265738d5e035197204bbb63cfa81
* | | | | | | Use calling app's Network Security Config for HTTPS downloadsChad Brubaker2016-06-203-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug:29505888 Change-Id: Ifc33fd75e44d1dbc5a4ce5caa8e1ff938b94623e
* | | | | | | Only show queued notification when "visible."Jeff Sharkey2016-05-261-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise it's confusing to see notifications for downloads that are otherwise invisible. Bug: 28623639 Change-Id: I1b2aeccfcca1369f66c56c441dfef68ee95c6d62
* | | | | | | Implemented onRestrictBackgroundBlacklistChanged().Felipe Leme2016-05-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: 28743623 Change-Id: I314febe06e5516dfa69062da691e0189b051dac5
* | | | | | | Merge "Removed onRestrictPowerChanged()." into nyc-devTreeHugger Robot2016-05-131-6/+0
|\ \ \ \ \ \ \
| * | | | | | | Removed onRestrictPowerChanged().Felipe Leme2016-05-101-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: 28521946 Change-Id: I32129977c121b610bdd1a780fd371baaff3ead4b
* | | | | | | | Merge "Allow viewing content:// Uris from Downloads." into nyc-devTomasz Mikolajewski2016-05-111-4/+1
|\ \ \ \ \ \ \ \
| * | | | | | | | Allow viewing content:// Uris from Downloads.Tomasz Mikolajewski2016-05-091-4/+1
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 28476442 Change-Id: I12a35a2c35c16ddf899637dfb85c30006c169fd7
* / / / / / / / Scan completed downloads when requested.Jeff Sharkey2016-05-092-4/+17
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent JobScheduler rewrite means we no longer spin up a service when insterting an already-completed download. However, the calling app may have requested the download to be scanned, so kick off a scan request for them. Bug: 28659693 Change-Id: I497e10995ba04f1522fe8d7e547ebea6e305f6e9
* | | | | | | Implemented onRestrictPowerChanged().Felipe Leme2016-05-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: 28521946 Change-Id: I31658e680e67da9e1a420a9749a67949cfe09689
* | | | | | | Merge "Add ability to rename a downloaded file." into nyc-devBen Lin2016-05-021-1/+20
|\ \ \ \ \ \ \
| * | | | | | | Add ability to rename a downloaded file.Ben Lin2016-04-291-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 28359663 Change-Id: Id74ab041717f553bbd81ab2f69b1b8fa0d4d230d
* | | | | | | | Visible downloads should run while blocked/dozing.Jeff Sharkey2016-04-295-20/+42
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | Move DownloadManager to use JobScheduler.Jeff Sharkey2016-04-2514-1283/+711
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | Implemented onRestrictBackgroundWhitelistChanged().Felipe Leme2016-04-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: 27481520 Change-Id: I84db23b62f60dadefc01ead78f13ed689943baad
* | | | | | | Extra comments for multinetwork downloadingRobin Lee2016-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 27074270 Change-Id: I7145fcdf0c8af0f0c299ca491f01eaef6204e2cb
* | | | | | | Merge "Implement multi-network downloads" into nyc-devRobin Lee2016-04-073-1/+20
|\ \ \ \ \ \ \