Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fd11292 authored by Steve Howard's avatar Steve Howard Committed by Android Git Automerger
Browse files

am bb0d23b5: Have DownloadManager pass file URIs for legacy external downloads

Merge commit 'bb0d23b5' into gingerbread-plus-aosp

* commit 'bb0d23b5':
  Have DownloadManager pass file URIs for legacy external downloads
parents 8449490a bb0d23b5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -247,6 +247,7 @@ public class DownloadManager {
        Downloads.COLUMN_LAST_MODIFICATION,
        Downloads.COLUMN_DESTINATION,
        Downloads.Impl.COLUMN_FILE_NAME_HINT,
        Downloads.Impl._DATA,
    };

    private static final Set<String> LONG_COLUMNS = new HashSet<String>(
@@ -881,6 +882,11 @@ public class DownloadManager {
                return getUnderlyingString(Downloads.Impl.COLUMN_FILE_NAME_HINT);
            }

            if (destinationType == Downloads.Impl.DESTINATION_EXTERNAL) {
                // return stored destination for legacy external download
                return Uri.fromFile(new File(getUnderlyingString(Downloads.Impl._DATA))).toString();
            }

            // return content URI for cache download
            long downloadId = getUnderlyingLong(Downloads.Impl._ID);
            return ContentUris.withAppendedId(mBaseUri, downloadId).toString();