am 5c29cce0: am e1823c84: Don\'t filter by UID for apps with ACCESS_ALL_DOWNLOADS
Kenny Root [Wed, 1 Dec 2010 22:23:13 +0000 (14:23 -0800)]
* commit '5c29cce0bac00a7a32cd92210825a789e140cf94':
  Don't filter by UID for apps with ACCESS_ALL_DOWNLOADS

1  2 
src/com/android/providers/downloads/DownloadProvider.java

@@@ -992,11 -972,12 +992,13 @@@ public final class DownloadProvider ext
              int uriMatch) {
          SqlSelection selection = new SqlSelection();
          selection.appendClause(where, whereArgs);
 -        if (uriMatch == MY_DOWNLOADS_ID || uriMatch == ALL_DOWNLOADS_ID) {
 +        if (uriMatch == MY_DOWNLOADS_ID || uriMatch == ALL_DOWNLOADS_ID ||
 +                uriMatch == PUBLIC_DOWNLOAD_ID) {
              selection.appendClause(Downloads.Impl._ID + " = ?", getDownloadIdFromUri(uri));
          }
-         if (uriMatch == MY_DOWNLOADS || uriMatch == MY_DOWNLOADS_ID) {
+         if ((uriMatch == MY_DOWNLOADS || uriMatch == MY_DOWNLOADS_ID)
+                 && getContext().checkCallingPermission(Downloads.Impl.PERMISSION_ACCESS_ALL)
+                 != PackageManager.PERMISSION_GRANTED) {
              selection.appendClause(
                      Constants.UID + "= ? OR " + Downloads.Impl.COLUMN_OTHER_UID + "= ?",
                      Binder.getCallingUid(), Binder.getCallingPid());