am bb0d23b5: Have DownloadManager pass file URIs for legacy external downloads
Merge commit 'bb0d23b5475cb516fa6f61ee3fe4e7b79cd980f8' into gingerbread-plus-aosp * commit 'bb0d23b5475cb516fa6f61ee3fe4e7b79cd980f8': Have DownloadManager pass file URIs for legacy external downloads
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user