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

Commit e8f006a1 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Jessica Wagantall
Browse files

Merge commit '0a9d537f' into manual_merge_0a9d537

CYNGNOS-3303
Change-Id: Ib1a0bbb34edb61666ac5739f0b0eaadbe4c5fe06
parent d8a818fb
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -1030,24 +1030,7 @@ public class DownloadManager {
            if (cursor.moveToFirst()) {
                int status = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_STATUS));
                if (DownloadManager.STATUS_SUCCESSFUL == status) {
                    int indx = cursor.getColumnIndexOrThrow(
                            Downloads.Impl.COLUMN_DESTINATION);
                    int destination = cursor.getInt(indx);
                    // TODO: if we ever add API to DownloadManager to let the caller specify
                    // non-external storage for a downloaded file, then the following code
                    // should also check for that destination.
                    if (destination == Downloads.Impl.DESTINATION_CACHE_PARTITION ||
                            destination == Downloads.Impl.DESTINATION_SYSTEMCACHE_PARTITION ||
                            destination == Downloads.Impl.DESTINATION_CACHE_PARTITION_NOROAMING ||
                            destination == Downloads.Impl.DESTINATION_CACHE_PARTITION_PURGEABLE) {
                        // return private uri
                    return ContentUris.withAppendedId(Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI, id);
                    } else {
                        // return public uri
                        String path = cursor.getString(
                                cursor.getColumnIndexOrThrow(COLUMN_LOCAL_FILENAME));
                        return Uri.fromFile(new File(path));
                    }
                }
            }
        } finally {