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

Commit bb7b488b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Download: use "control" column to mark paused/resumed status"

parents 58b0cc72 0d5563b7
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ public class DownloadManager {
    *
    * @hide
    */
    public final static int PAUSED_BY_USER = 5;
    public final static int PAUSED_BY_APP = 5;

    /**
     * Broadcast intent action sent by the download manager when a download completes.
@@ -872,7 +872,6 @@ public class DownloadManager {
                    parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_TO_RETRY));
                    parts.add(statusClause("=", Downloads.Impl.STATUS_WAITING_FOR_NETWORK));
                    parts.add(statusClause("=", Downloads.Impl.STATUS_QUEUED_FOR_WIFI));
                    parts.add(statusClause("=", Downloads.Impl.STATUS_PAUSED_BY_USER));
                }
                if ((mStatusFlags & STATUS_SUCCESSFUL) != 0) {
                    parts.add(statusClause("=", Downloads.Impl.STATUS_SUCCESS));
@@ -1136,7 +1135,7 @@ public class DownloadManager {
     */
    public void pauseDownload(long id) {
        ContentValues values = new ContentValues();
        values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_PAUSED_BY_USER);
        values.put(Downloads.Impl.COLUMN_CONTROL, Downloads.Impl.CONTROL_PAUSED);
        mResolver.update(ContentUris.withAppendedId(mBaseUri, id), values, null, null);
    }

@@ -1148,7 +1147,7 @@ public class DownloadManager {
     */
    public void resumeDownload(long id) {
       ContentValues values = new ContentValues();
       values.put(Downloads.Impl.COLUMN_STATUS, Downloads.Impl.STATUS_RUNNING);
       values.put(Downloads.Impl.COLUMN_CONTROL, Downloads.Impl.CONTROL_RUN);
       mResolver.update(ContentUris.withAppendedId(mBaseUri, id), values, null, null);
    }

@@ -1388,8 +1387,8 @@ public class DownloadManager {
                case Downloads.Impl.STATUS_QUEUED_FOR_WIFI:
                    return PAUSED_QUEUED_FOR_WIFI;

                case Downloads.Impl.STATUS_PAUSED_BY_USER:
                    return PAUSED_BY_USER;
                case Downloads.Impl.STATUS_PAUSED_BY_APP:
                    return PAUSED_BY_APP;

                default:
                    return PAUSED_UNKNOWN;
@@ -1446,7 +1445,6 @@ public class DownloadManager {
                case Downloads.Impl.STATUS_WAITING_TO_RETRY:
                case Downloads.Impl.STATUS_WAITING_FOR_NETWORK:
                case Downloads.Impl.STATUS_QUEUED_FOR_WIFI:
                case Downloads.Impl.STATUS_PAUSED_BY_USER:
                    return STATUS_PAUSED;

                case Downloads.Impl.STATUS_SUCCESS:
+0 −5
Original line number Diff line number Diff line
@@ -592,11 +592,6 @@ public final class Downloads {
         */
        public static final int STATUS_QUEUED_FOR_WIFI = 196;

        /**
         * This download has been paused by user.
         */
        public static final int STATUS_PAUSED_BY_USER = 197;

        /**
         * This download couldn't be completed due to insufficient storage
         * space.  Typically, this is because the SD card is full.