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

Commit ee04af3e authored by Doug Zongker's avatar Doug Zongker
Browse files

add a local filename column to download queries

Some users of the download API (eg system update) need to get the
actual local filename of a downloaded file, not just a content URI.

Change-Id: I877e2776e778c1712f654ba5c840bfe6ed3fe60f
parent 90078b3f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -28921,6 +28921,17 @@
 visibility="public"
>
</field>
<field name="COLUMN_LOCAL_FILENAME"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;local_filename&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="COLUMN_LOCAL_URI"
 type="java.lang.String"
 transient="false"
+10 −1
Original line number Diff line number Diff line
@@ -98,6 +98,11 @@ public class DownloadManager {
     */
    public final static String COLUMN_LOCAL_URI = "local_uri";

    /**
     * The pathname of the file where the download is stored.
     */
    public final static String COLUMN_LOCAL_FILENAME = "local_filename";

    /**
     * Current status of the download, as one of the STATUS_* constants.
     */
@@ -272,7 +277,8 @@ public class DownloadManager {
        COLUMN_STATUS,
        COLUMN_REASON,
        COLUMN_BYTES_DOWNLOADED_SO_FAR,
        COLUMN_LAST_MODIFIED_TIMESTAMP
        COLUMN_LAST_MODIFIED_TIMESTAMP,
        COLUMN_LOCAL_FILENAME
    };

    // columns to request from DownloadProvider
@@ -915,6 +921,9 @@ public class DownloadManager {
            if (column.equals(COLUMN_MEDIA_TYPE)) {
                return getUnderlyingString(Downloads.COLUMN_MIME_TYPE);
            }
            if (column.equals(COLUMN_LOCAL_FILENAME)) {
                return getUnderlyingString(Downloads.Impl._DATA);
            }

            assert column.equals(COLUMN_LOCAL_URI);
            return getLocalUri();