summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2014-08-05 18:04:54 -0700
committerJeff Sharkey <jsharkey@android.com>2014-08-05 18:04:54 -0700
commit2e16979a9133ef83f6e513eaa4b84de40350a2dd (patch)
tree918feabbba060276b6c84073912ecaf7120b7ba0 /src
parent495edec1d9f7659923c71b009db66c1bd4782034 (diff)
downloadandroid_packages_providers_DownloadProvider-2e16979a9133ef83f6e513eaa4b84de40350a2dd.zip
android_packages_providers_DownloadProvider-2e16979a9133ef83f6e513eaa4b84de40350a2dd.tar.gz
android_packages_providers_DownloadProvider-2e16979a9133ef83f6e513eaa4b84de40350a2dd.tar.bz2
Whoops, clear identity to get internal columns.
Bug: 16822344 Change-Id: Ib90e171cbb7babc7a3eea59de5cb899c79fadf94
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index 5b45c3f..4b23024 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -821,6 +821,16 @@ public final class DownloadProvider extends ContentProvider {
throw new SecurityException("Invalid value for " + column + ": " + value);
}
+ private Cursor queryCleared(Uri uri, String[] projection, String selection,
+ String[] selectionArgs, String sort) {
+ final long token = Binder.clearCallingIdentity();
+ try {
+ return query(uri, projection, selection, selectionArgs, sort);
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
/**
* Starts a database query
*/
@@ -1182,7 +1192,7 @@ public final class DownloadProvider extends ContentProvider {
logVerboseOpenFileInfo(uri, mode);
}
- final Cursor cursor = query(uri, new String[] {
+ final Cursor cursor = queryCleared(uri, new String[] {
Downloads.Impl._DATA, Downloads.Impl.COLUMN_STATUS,
Downloads.Impl.COLUMN_DESTINATION, Downloads.Impl.COLUMN_MEDIA_SCANNED }, null,
null, null);