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

Commit 9c7bec25 authored by Steve Howard's avatar Steve Howard Committed by Android Git Automerger
Browse files

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

Merge commit '1fd11292'

* commit '1fd11292':
  Have DownloadManager pass file URIs for legacy external downloads
parents 1c134d55 1fd11292
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();