Trim stale downloads from third-party apps.
authorJeff Sharkey <jsharkey@android.com>
Thu, 16 Oct 2014 21:40:23 +0000 (14:40 -0700)
committerJeff Sharkey <jsharkey@android.com>
Thu, 16 Oct 2014 21:40:25 +0000 (14:40 -0700)
commite24609e8f2aada5cb8ac1c3e93141b260e201efe
treeed8b091087e78fcd6101f3f40fb66422dfe03a2f
parente8175658d3a16a3fd8c60a9c6760268e74d0b81f
Trim stale downloads from third-party apps.

Buggy third-party apps can enqueue lots of downloads and then
forget to remove them, causing DownloadManager to stop functioning.

This change removes any downloads that match _all_ of the following
conditions:

1. Download status is in a terminal (non-pending) state, usually a
concrete success or failure.
2. Download hasn't been touched in over a week.
3. Download is not visible in UI.

Bug: 17785419
Change-Id: Id82752fd6935371c1af682205d35f7ba35169473
src/com/android/providers/downloads/DownloadIdleService.java