summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-07-06 10:42:56 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-07-06 10:42:56 -0700
commit4ed4c65f46f5d077bb40f82e7a4821bd47217fdd (patch)
treeb9cea6599284f2330ed96516317550664144089d
parent942f86951acec0850fd0f75909f2dee72fa490d1 (diff)
parentf0fa1cdc1a36cbe0abd57ef9cf9a636fd1d3e2c8 (diff)
downloadandroid_packages_providers_DownloadProvider-4ed4c65f46f5d077bb40f82e7a4821bd47217fdd.tar.gz
android_packages_providers_DownloadProvider-4ed4c65f46f5d077bb40f82e7a4821bd47217fdd.tar.bz2
android_packages_providers_DownloadProvider-4ed4c65f46f5d077bb40f82e7a4821bd47217fdd.zip
Merge commit 'f0fa1cdc' into manualmerge
Fix crash in discardPurgeableFiles with proper selection syntax. The basic crash is that this codepath was doing a query to the download provider without properly quoting its selection arguments (which is mandated by the download provider). A secondary crash is that the DESTINATION column wasn't readable. This fixes bug 1941125. Tested by force-calling discardPurgeableFiles for each download to /cache, locally adding a few debugging statements to be sure that the codepath was getting executed, and doing a market download. Conflicts: src/com/android/providers/downloads/DownloadProvider.java src/com/android/providers/downloads/Helpers.java
-rw-r--r--docs/index.html1
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java1
-rw-r--r--src/com/android/providers/downloads/Helpers.java4
3 files changed, 4 insertions, 2 deletions
diff --git a/docs/index.html b/docs/index.html
index a073a004..0004b729 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -231,6 +231,7 @@ Here's the list of columns that can currently be read/queried, with comments:
<tr><td > <code>_DATA</code> </td><td > Probably should not be visible to applications. <b>WARNING</b> Security concern: This holds filenames, including those of private files. While file permissions are supposed to kick in and protect the files, hiding private filenames deeper in would probably be a reasonable idea. </td></tr>
<tr><td > <code>MIMETYPE</code> </td><td > Needs to be visible so that app can display the icon matching the mime type. Intended to be visible by 3rd-party download UIs. <b>TODO</b> Security TBD before we implement support for 3rd-party UIs. </td></tr>
<tr><td > <code>VISIBILITY</code> </td><td > Needs to be visible in case an app has both visible and invisible downloads. No obvious security concern. </td></tr>
+<tr><td > <code>DESTINATION</code> </td><td > Needs to be visible in case an app has multiple destinations and wants to distinguish between them. Also used internally by the download manager. No obvious security concern. </td></tr>
<tr><td > <code>STATUS</code> </td><td > Needs to be visible (1004). No obvious security concern. </td></tr>
<tr><td > <code>LAST_MODIFICATION</code> </td><td > Needs to be visible, e.g. so that apps can sort downloads by date of last activity, or discard old downloads. No obvious security concern. </td></tr>
<tr><td > <code>NOTIFICATION_PACKAGE</code> </td><td > Allows individual apps running under shared UIDs to identify their own downloads. No security concern: can be queried through package manager. </td></tr>
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index 0ce6b22b..f0190fd1 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -81,6 +81,7 @@ public final class DownloadProvider extends ContentProvider {
Downloads._DATA,
Downloads.COLUMN_MIME_TYPE,
Downloads.COLUMN_VISIBILITY,
+ Downloads.COLUMN_DESTINATION,
Downloads.COLUMN_CONTROL,
Downloads.COLUMN_STATUS,
Downloads.COLUMN_LAST_MODIFICATION,
diff --git a/src/com/android/providers/downloads/Helpers.java b/src/com/android/providers/downloads/Helpers.java
index 866cddcb..d8f262c7 100644
--- a/src/com/android/providers/downloads/Helpers.java
+++ b/src/com/android/providers/downloads/Helpers.java
@@ -426,9 +426,9 @@ public class Helpers {
Downloads.CONTENT_URI,
null,
"( " +
- Downloads.COLUMN_STATUS + " = " + Downloads.STATUS_SUCCESS + " AND " +
+ Downloads.COLUMN_STATUS + " = '" + Downloads.STATUS_SUCCESS + "' AND " +
Downloads.COLUMN_DESTINATION +
- " = " + Downloads.DESTINATION_CACHE_PARTITION_PURGEABLE + " )",
+ " = '" + Downloads.DESTINATION_CACHE_PARTITION_PURGEABLE + "' )",
null,
Downloads.COLUMN_LAST_MODIFICATION);
if (cursor == null) {