Downloads.java revision 8da7a4e3451a41808972bfec0af0740e999d9c8a
1cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn/*
2cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * Copyright (C) 2008 The Android Open Source Project
3cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *
4cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * Licensed under the Apache License, Version 2.0 (the "License");
5cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * you may not use this file except in compliance with the License.
6cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * You may obtain a copy of the License at
7cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *
8cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *      http://www.apache.org/licenses/LICENSE-2.0
9cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *
10cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * Unless required by applicable law or agreed to in writing, software
11cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * distributed under the License is distributed on an "AS IS" BASIS,
12cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * See the License for the specific language governing permissions and
14cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * limitations under the License.
15cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn */
16cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
17cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornpackage android.provider;
18cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
194500be62dea3895a98336122a2944cc4ab024bc5George Mountimport android.app.DownloadManager;
20cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornimport android.net.Uri;
21cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
223a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn/**
234500be62dea3895a98336122a2944cc4ab024bc5George Mount * The Download Manager
24cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *
25cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * @pending
264500be62dea3895a98336122a2944cc4ab024bc5George Mount */
274500be62dea3895a98336122a2944cc4ab024bc5George Mountpublic final class Downloads {
28cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    private Downloads() {}
29cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
30cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    /**
31cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * Implementation details
32cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     *
33cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * Exposes constants used to interact with the download manager's
34cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * content provider.
35cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * The constants URI ... STATUS are the names of columns in the downloads table.
36cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     *
37cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * @hide
38cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     */
39cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public static final class Impl implements BaseColumns {
40cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        private Impl() {}
41cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
42cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
434500be62dea3895a98336122a2944cc4ab024bc5George Mount         * The permission to access the download manager
444500be62dea3895a98336122a2944cc4ab024bc5George Mount         */
454500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final String PERMISSION_ACCESS = "android.permission.ACCESS_DOWNLOAD_MANAGER";
464500be62dea3895a98336122a2944cc4ab024bc5George Mount
47cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
48cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The permission to access the download manager's advanced functions
49cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
50cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String PERMISSION_ACCESS_ADVANCED =
51cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                "android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED";
52cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
53cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
54cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The permission to directly access the download manager's cache directory
55df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         */
56cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String PERMISSION_CACHE = "android.permission.ACCESS_CACHE_FILESYSTEM";
57cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
58cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
59cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The permission to send broadcasts on download completion
60cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
61cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String PERMISSION_SEND_INTENTS =
62cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                "android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS";
63cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
64cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
655506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn         * The permission to download files to the cache partition that won't be automatically
66cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * purged when space is needed.
67cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
68df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn        public static final String PERMISSION_CACHE_NON_PURGEABLE =
69df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn                "android.permission.DOWNLOAD_CACHE_NON_PURGEABLE";
70cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
71cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
72cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The permission to download files without any system notification being shown.
73cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
74cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String PERMISSION_NO_NOTIFICATION =
75cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                "android.permission.DOWNLOAD_WITHOUT_NOTIFICATION";
76cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
77cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
78cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The content:// URI to access downloads owned by the caller's UID.
79cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
80cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final Uri CONTENT_URI =
81cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                Uri.parse("content://downloads/my_downloads");
82cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
83cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
84cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The content URI for accessing all downloads across all UIDs (requires the
85cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * ACCESS_ALL_DOWNLOADS permission).
86cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
87cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final Uri ALL_DOWNLOADS_CONTENT_URI =
88cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                Uri.parse("content://downloads/all_downloads");
894500be62dea3895a98336122a2944cc4ab024bc5George Mount
904500be62dea3895a98336122a2944cc4ab024bc5George Mount        /** URI segment to access a publicly accessible downloaded file */
914500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final String PUBLICLY_ACCESSIBLE_DOWNLOADS_URI_SEGMENT = "public_downloads";
924500be62dea3895a98336122a2944cc4ab024bc5George Mount
93cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
94cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The content URI for accessing publicly accessible downloads (i.e., it requires no
95cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * permissions to access this downloaded file)
96cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
97cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final Uri PUBLICLY_ACCESSIBLE_DOWNLOADS_URI =
98cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                Uri.parse("content://downloads/" + PUBLICLY_ACCESSIBLE_DOWNLOADS_URI_SEGMENT);
99cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
100cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
101cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Broadcast Action: this is sent by the download manager to the app
102cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * that had initiated a download when that download completes. The
103cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * download's content: uri is specified in the intent's data.
104cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
1054500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final String ACTION_DOWNLOAD_COMPLETED =
1064500be62dea3895a98336122a2944cc4ab024bc5George Mount                "android.intent.action.DOWNLOAD_COMPLETED";
1074500be62dea3895a98336122a2944cc4ab024bc5George Mount
1084500be62dea3895a98336122a2944cc4ab024bc5George Mount        /**
109cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Broadcast Action: this is sent by the download manager to the app
110cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * that had initiated a download when the user selects the notification
111cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * associated with that download. The download's content: uri is specified
112cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * in the intent's data if the click is associated with a single download,
113cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * or Downloads.CONTENT_URI if the notification is associated with
1143a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * multiple downloads.
115cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Note: this is not currently sent for downloads that have completed
116cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * successfully.
117cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
118cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String ACTION_NOTIFICATION_CLICKED =
1193a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn                "android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED";
1205506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn
1215506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn        /**
1225506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn         * The name of the column containing the URI of the data being downloaded.
1235506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn         * <P>Type: TEXT</P>
1245506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn         * <P>Owner can Init/Read</P>
1255506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn         */
1265506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn        public static final String COLUMN_URI = "uri";
127cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
128cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
129df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * The name of the column containing application-specific data.
130df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * <P>Type: TEXT</P>
131cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init/Read/Write</P>
132cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
133cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_APP_DATA = "entity";
134cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
135cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
1363a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column containing the flags that indicates whether
137cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * the initiating application is capable of verifying the integrity of
138cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * the downloaded file. When this flag is set, the download manager
139cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * performs downloads and reports success even in some situations where
140cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * it can't guarantee that the download has completed (e.g. when doing
141cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * a byte-range request without an ETag, or when it can't determine
1423a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * whether a download fully completed).
143cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: BOOLEAN</P>
144cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init</P>
145cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
146cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_NO_INTEGRITY = "no_integrity";
147cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
148cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
149cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the filename that the initiating
150cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * application recommends. When possible, the download manager will attempt
151cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * to use this filename, or a variation, as the actual name for the file.
152cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
1534500be62dea3895a98336122a2944cc4ab024bc5George Mount         * <P>Owner can Init</P>
1544500be62dea3895a98336122a2944cc4ab024bc5George Mount         */
1554500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final String COLUMN_FILE_NAME_HINT = "hint";
1564500be62dea3895a98336122a2944cc4ab024bc5George Mount
157cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
158cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the filename where the downloaded data
159cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * was actually stored.
160cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
161cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Read</P>
162cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
163cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String _DATA = "_data";
164cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
165cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
166cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the MIME type of the downloaded data.
167cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
168cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init/Read</P>
169cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
170cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_MIME_TYPE = "mimetype";
171cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
172cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
173cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the flag that controls the destination
174cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * of the download. See the DESTINATION_* constants for a list of legal values.
1754500be62dea3895a98336122a2944cc4ab024bc5George Mount         * <P>Type: INTEGER</P>
1764500be62dea3895a98336122a2944cc4ab024bc5George Mount         * <P>Owner can Init</P>
1774500be62dea3895a98336122a2944cc4ab024bc5George Mount         */
1784500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final String COLUMN_DESTINATION = "destination";
179cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
180cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
181cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the flags that controls whether the
182cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * download is displayed by the UI. See the VISIBILITY_* constants for
183cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * a list of legal values.
184cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: INTEGER</P>
185cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init/Read/Write</P>
186cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
187cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_VISIBILITY = "visibility";
188cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
189cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
190cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the current control state  of the download.
191cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Applications can write to this to control (pause/resume) the download.
192cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * the CONTROL_* constants for a list of legal values.
193cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: INTEGER</P>
194cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Read</P>
195cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
196cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_CONTROL = "control";
197cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
1983a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
199cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the current status of the download.
200cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Applications can read this to follow the progress of each download. See
201cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * the STATUS_* constants for a list of legal values.
202cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: INTEGER</P>
203cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Read</P>
204cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
205cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_STATUS = "status";
206cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
207cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
208eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn         * The name of the column containing the date at which some interesting
209eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn         * status changed in the download. Stored as a System.currentTimeMillis()
210cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * value.
211cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: BIGINT</P>
212cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Read</P>
213cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
214cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_LAST_MODIFICATION = "lastmod";
215cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
216cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
217cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the package name of the application
218df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * that initiating the download. The download manager will send
219df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * notifications to a component in this package when the download completes.
220cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
221cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init/Read</P>
222cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
223cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_NOTIFICATION_PACKAGE = "notificationpackage";
224cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
225cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
226cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column containing the component name of the class that
227cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * will receive notifications associated with the download. The
228df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * package/class combination is passed to
229df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * Intent.setClassName(String,String).
230cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
231cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init/Read</P>
232cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
233cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_NOTIFICATION_CLASS = "notificationclass";
234cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
235cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
2363a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * If extras are specified when requesting a download they will be provided in the intent that
237cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * is sent to the specified class and package when a download has finished.
238cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
239cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init</P>
240cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
241cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_NOTIFICATION_EXTRAS = "notificationextras";
242cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
2434500be62dea3895a98336122a2944cc4ab024bc5George Mount        /**
2444500be62dea3895a98336122a2944cc4ab024bc5George Mount         * The name of the column contain the values of the cookie to be used for
2454500be62dea3895a98336122a2944cc4ab024bc5George Mount         * the download. This is used directly as the value for the Cookie: HTTP
2464500be62dea3895a98336122a2944cc4ab024bc5George Mount         * header that gets sent with the request.
2474500be62dea3895a98336122a2944cc4ab024bc5George Mount         * <P>Type: TEXT</P>
2483a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Init</P>
2493a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
2503a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_COOKIE_DATA = "cookiedata";
2513a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
2523a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
2533a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column containing the user agent that the initiating
2543a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * application wants the download manager to use for this download.
2553a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: TEXT</P>
256df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * <P>Owner can Init</P>
2573a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
2583a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_USER_AGENT = "useragent";
2593a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
260cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
2613a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column containing the referer (sic) that the initiating
2623a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * application wants the download manager to use for this download.
2633a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: TEXT</P>
2643a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Init</P>
2653a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
2663a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_REFERER = "referer";
2673a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
2683a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
2693a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column containing the total size of the file being
2703a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * downloaded.
2713a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: INTEGER</P>
2723a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Read</P>
2733a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
2743a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_TOTAL_BYTES = "total_bytes";
2753a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
2763a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
2773a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column containing the size of the part of the file that
2783a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * has been downloaded so far.
2793a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: INTEGER</P>
2803a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Read</P>
2813a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
2823a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_CURRENT_BYTES = "current_bytes";
2833a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
2843a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
2853a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column where the initiating application can provide the
2863a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * UID of another application that is allowed to access this download. If
2873a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * multiple applications share the same UID, all those applications will be
2883a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * allowed to access this download. This column can be updated after the
2893a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * download is initiated. This requires the permission
2903a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED.
2913a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: INTEGER</P>
2923a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Init</P>
2933a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
2943a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_OTHER_UID = "otheruid";
2953a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
2963a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
2973a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column where the initiating application can provided the
2983a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * title of this download. The title will be displayed ito the user in the
2993a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * list of downloads.
3003a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: TEXT</P>
3013a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Init/Read/Write</P>
3023a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
3033a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_TITLE = "title";
304cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
305cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
306cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The name of the column where the initiating application can provide the
307cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * description of this download. The description will be displayed to the
308cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * user in the list of downloads.
309cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
310cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init/Read/Write</P>
311cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
3123a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_DESCRIPTION = "description";
3133a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
3143a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
3153a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column indicating whether the download was requesting through the public
3163a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * API.  This controls some differences in behavior.
3173a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: BOOLEAN</P>
3183a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Init/Read</P>
3193a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
3203a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_IS_PUBLIC_API = "is_public_api";
3213a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
3223a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
323df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * The name of the column indicating whether roaming connections can be used.  This is only
3243a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * used for public API downloads.
3253a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: BOOLEAN</P>
3263a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Init/Read</P>
3273a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
3283a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_ALLOW_ROAMING = "allow_roaming";
3293a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
3303a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
3313a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * The name of the column holding a bitmask of allowed network types.  This is only used for
3323a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * public API downloads.
3333a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: INTEGER</P>
3343a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Owner can Init/Read</P>
3353a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
3363a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final String COLUMN_ALLOWED_NETWORK_TYPES = "allowed_network_types";
3373a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
3383a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
3393a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * Whether or not this download should be displayed in the system's Downloads UI.  Defaults
340cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * to true.
341cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: INTEGER</P>
342cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Init/Read</P>
343cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
344cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_IS_VISIBLE_IN_DOWNLOADS_UI = "is_visible_in_downloads_ui";
345cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
346cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
3473a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * If true, the user has confirmed that this download can proceed over the mobile network
3483a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * even though it exceeds the recommended maximum size.
3493a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: BOOLEAN</P>
3503a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
351cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_BYPASS_RECOMMENDED_SIZE_LIMIT =
352cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            "bypass_recommended_size_limit";
353cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
354cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
355cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Set to true if this download is deleted. It is completely removed from the database
356cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * when MediaProvider database also deletes the metadata asociated with this downloaded file.
3573a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * <P>Type: BOOLEAN</P>
358cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Read</P>
359cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
360cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_DELETED = "deleted";
361cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
362cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
363cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The URI to the corresponding entry in MediaProvider for this downloaded entry. It is
364cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * used to delete the entries from MediaProvider database when it is deleted from the
365cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * downloaded list.
366cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
367cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Owner can Read</P>
368cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
369cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_MEDIAPROVIDER_URI = "mediaprovider_uri";
370cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
371cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
372cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The column that is used to remember whether the media scanner was invoked.
373cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * It can take the values: null or 0(not scanned), 1(scanned), 2 (not scannable).
374cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
375cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
376cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_MEDIA_SCANNED = "scanned";
377cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
378cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
379cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The column with errorMsg for a failed downloaded.
380cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Used only for debugging purposes.
381cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: TEXT</P>
382cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
383cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_ERROR_MSG = "errorMsg";
384cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
385cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
386cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         *  This column stores the source of the last update to this row.
387cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         *  This column is only for internal use.
388cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         *  Valid values are indicated by LAST_UPDATESRC_* constants.
389cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * <P>Type: INT</P>
390cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
391cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final String COLUMN_LAST_UPDATESRC = "lastUpdateSrc";
392cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
393cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
394cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * default value for {@link #COLUMN_LAST_UPDATESRC}.
395cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This value is used when this column's value is not relevant.
396cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
397cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int LAST_UPDATESRC_NOT_RELEVANT = 0;
398cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
399cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
400cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * One of the values taken by {@link #COLUMN_LAST_UPDATESRC}.
401cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This value is used when the update is NOT to be relayed to the DownloadService
402df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * (and thus spare DownloadService from scanning the database when this change occurs)
403df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         */
404cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int LAST_UPDATESRC_DONT_NOTIFY_DOWNLOADSVC = 1;
405cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
406cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /*
407cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Lists the destinations that an application can specify for a download.
408cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
409cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
410cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
411cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download will be saved to the external storage. This is the
412cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * default behavior, and should be used for any file that the user
413cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * can freely access, copy, delete. Even with that destination,
414cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * unencrypted DRM files are saved in secure internal storage.
415cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Downloads to the external destination only write files for which
416cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * there is a registered handler. The resulting files are accessible
417cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * by filename to all applications.
418cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
419cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int DESTINATION_EXTERNAL = 0;
420cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
421cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
422cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download will be saved to the download manager's private
423cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * partition. This is the behavior used by applications that want to
424cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * download private files that are used and deleted soon after they
425cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * get downloaded. All file types are allowed, and only the initiating
426cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * application can access the file (indirectly through a content
427cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * provider). This requires the
428cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED permission.
429cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
430cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int DESTINATION_CACHE_PARTITION = 1;
431cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
432cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
433cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download will be saved to the download manager's private
434cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * partition and will be purged as necessary to make space. This is
435cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * for private files (similar to CACHE_PARTITION) that aren't deleted
436cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * immediately after they are used, and are kept around by the download
437cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * manager as long as space is available.
438cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
439cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int DESTINATION_CACHE_PARTITION_PURGEABLE = 2;
440cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
441cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
442cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download will be saved to the download manager's private
443cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * partition, as with DESTINATION_CACHE_PARTITION, but the download
444cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * will not proceed if the user is on a roaming data connection.
445cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
446cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int DESTINATION_CACHE_PARTITION_NOROAMING = 3;
447cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
448cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
449cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download will be saved to the location given by the file URI in
450cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * {@link #COLUMN_FILE_NAME_HINT}.
451cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
452cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int DESTINATION_FILE_URI = 4;
453cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
454cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
455cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download is allowed to run.
456cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
457cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int CONTROL_RUN = 0;
458cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
459cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
460cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download must pause at the first opportunity.
461cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
462cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int CONTROL_PAUSED = 1;
463cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
464cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /*
465cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Lists the states that the download manager can set on a download
466cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * to notify applications of the download progress.
467cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The codes follow the HTTP families:<br>
468cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * 1xx: informational<br>
469cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * 2xx: success<br>
470cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * 3xx: redirects (not used by the download manager)<br>
471cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * 4xx: client errors<br>
472cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * 5xx: server errors
473cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
474cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
475cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
476cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Returns whether the status is informational (i.e. 1xx).
477cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
478cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static boolean isStatusInformational(int status) {
479cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            return (status >= 100 && status < 200);
480cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
481cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
482cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
483cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Returns whether the status is a success (i.e. 2xx).
484cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
485cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static boolean isStatusSuccess(int status) {
486cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            return (status >= 200 && status < 300);
487cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
488cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
489eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn        /**
490eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn         * Returns whether the status is an error (i.e. 4xx or 5xx).
491eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn         */
492eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn        public static boolean isStatusError(int status) {
493eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn            return (status >= 400 && status < 600);
494eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn        }
495eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn
496eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn        /**
497eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn         * Returns whether the status is a client error (i.e. 4xx).
498eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn         */
499eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn        public static boolean isStatusClientError(int status) {
500eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn            return (status >= 400 && status < 500);
501eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn        }
502eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn
503eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn        /**
504eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn         * Returns whether the status is a server error (i.e. 5xx).
505eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn         */
506eedc67283a5a49dce86c625e54596dfdea9465a7Dianne Hackborn        public static boolean isStatusServerError(int status) {
507cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            return (status >= 500 && status < 600);
508df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn        }
509df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn
510df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn        /**
511df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * Returns whether the download has completed (either with success or
512df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn         * error).
513cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
514cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static boolean isStatusCompleted(int status) {
515df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn            return (status >= 200 && status < 300) || (status >= 400 && status < 600);
516df6f1393f73a488ba2661b28d3d88a5ac19c4ea2Dianne Hackborn        }
517cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
518cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
519cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download hasn't stated yet
520cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
521cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_PENDING = 190;
522cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
523cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
524cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download has started
5254500be62dea3895a98336122a2944cc4ab024bc5George Mount         */
5264500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final int STATUS_RUNNING = 192;
5274500be62dea3895a98336122a2944cc4ab024bc5George Mount
5284500be62dea3895a98336122a2944cc4ab024bc5George Mount        /**
5294500be62dea3895a98336122a2944cc4ab024bc5George Mount         * This download has been paused by the owning app.
5304500be62dea3895a98336122a2944cc4ab024bc5George Mount         */
5314500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final int STATUS_PAUSED_BY_APP = 193;
5324500be62dea3895a98336122a2944cc4ab024bc5George Mount
533128bb5c66d0b34c5a658c682deb3a0b9199b20c4George Mount        /**
5344500be62dea3895a98336122a2944cc4ab024bc5George Mount         * This download encountered some network error and is waiting before retrying the request.
5354500be62dea3895a98336122a2944cc4ab024bc5George Mount         */
5364500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final int STATUS_WAITING_TO_RETRY = 194;
5374500be62dea3895a98336122a2944cc4ab024bc5George Mount
5384500be62dea3895a98336122a2944cc4ab024bc5George Mount        /**
5394500be62dea3895a98336122a2944cc4ab024bc5George Mount         * This download is waiting for network connectivity to proceed.
540128bb5c66d0b34c5a658c682deb3a0b9199b20c4George Mount         */
541128bb5c66d0b34c5a658c682deb3a0b9199b20c4George Mount        public static final int STATUS_WAITING_FOR_NETWORK = 195;
542128bb5c66d0b34c5a658c682deb3a0b9199b20c4George Mount
543128bb5c66d0b34c5a658c682deb3a0b9199b20c4George Mount        /**
5444500be62dea3895a98336122a2944cc4ab024bc5George Mount         * This download exceeded a size limit for mobile networks and is waiting for a Wi-Fi
545128bb5c66d0b34c5a658c682deb3a0b9199b20c4George Mount         * connection to proceed.
5464500be62dea3895a98336122a2944cc4ab024bc5George Mount         */
5474500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final int STATUS_QUEUED_FOR_WIFI = 196;
5484500be62dea3895a98336122a2944cc4ab024bc5George Mount
5494500be62dea3895a98336122a2944cc4ab024bc5George Mount        /**
5504500be62dea3895a98336122a2944cc4ab024bc5George Mount         * This download has successfully completed.
551cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Warning: there might be other status values that indicate success
552cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * in the future.
553cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Use isSucccess() to capture the entire category.
554cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
555cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_SUCCESS = 200;
556cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
557cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
558cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This request couldn't be parsed. This is also used when processing
559cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * requests with unknown/unsupported URI schemes.
560cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
561cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_BAD_REQUEST = 400;
562cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
563cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
564cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download can't be performed because the content type cannot be
565cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * handled.
566cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
567cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_NOT_ACCEPTABLE = 406;
568cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
569cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
570cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download cannot be performed because the length cannot be
571cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * determined accurately. This is the code for the HTTP error "Length
572cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Required", which is typically used when making requests that require
573cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * a content length but don't have one, and it is also used in the
574cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * client when a response is received whose length cannot be determined
575cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * accurately (therefore making it impossible to know when a download
576cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * completes).
577cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
578cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_LENGTH_REQUIRED = 411;
579cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
580cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
581cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download was interrupted and cannot be resumed.
582cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This is the code for the HTTP error "Precondition Failed", and it is
583cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * also used in situations where the client doesn't have an ETag at all.
584cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
585cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_PRECONDITION_FAILED = 412;
586cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
587cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
588cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The lowest-valued error status that is not an actual HTTP status code.
589cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
590cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int MIN_ARTIFICIAL_ERROR_STATUS = 488;
591cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
592cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
593cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * The requested destination file already exists.
594cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
595cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_FILE_ALREADY_EXISTS_ERROR = 488;
596cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
597cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
598cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Some possibly transient error occurred, but we can't resume the download.
599cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
600cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_CANNOT_RESUME = 489;
601cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
602cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
603cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download was canceled
604cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
605cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_CANCELED = 490;
606cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
607cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
608cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download has completed with an error.
609cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Warning: there will be other status values that indicate errors in
610cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * the future. Use isStatusError() to capture the entire category.
6115506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn         */
6125506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn        public static final int STATUS_UNKNOWN_ERROR = 491;
6135506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn
6145506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn        /**
6155506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn         * This download couldn't be completed because of a storage issue.
616cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Typically, that's because the filesystem is missing or full.
617cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Use the more specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR}
618cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * and {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate.
619cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
620cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_FILE_ERROR = 492;
621cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
622cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
623cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download couldn't be completed because of an HTTP
624cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * redirect response that the download manager couldn't
625cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * handle.
626cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
627cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_UNHANDLED_REDIRECT = 493;
628cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
629cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
630cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download couldn't be completed because of an
631cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * unspecified unhandled HTTP code.
632cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
633cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_UNHANDLED_HTTP_CODE = 494;
634cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
635cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
636cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download couldn't be completed because of an
637cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * error receiving or processing data at the HTTP level.
6383a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         */
6393a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        public static final int STATUS_HTTP_DATA_ERROR = 495;
6403a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn
6413a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn        /**
6423a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * This download couldn't be completed because of an
6433a7571011a8f2c2e2685c4e3e7a6fa46673ee7eaDianne Hackborn         * HttpException while setting up the request.
644cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
645cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_HTTP_EXCEPTION = 496;
646cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
647cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
648cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download couldn't be completed because there were
649cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * too many redirects.
650cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
651cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_TOO_MANY_REDIRECTS = 497;
652cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
653cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
654cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download couldn't be completed due to insufficient storage
655cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * space.  Typically, this is because the SD card is full.
656cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
657cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498;
658cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
659cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
660cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download couldn't be completed because no external storage
661cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * device was found.  Typically, this is because the SD card is not
662cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * mounted.
663cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
664cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499;
6654500be62dea3895a98336122a2944cc4ab024bc5George Mount
6664500be62dea3895a98336122a2944cc4ab024bc5George Mount        /**
6674500be62dea3895a98336122a2944cc4ab024bc5George Mount         * This download is visible but only shows in the notifications
6684500be62dea3895a98336122a2944cc4ab024bc5George Mount         * while it's in progress.
669cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
670cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int VISIBILITY_VISIBLE = DownloadManager.Request.VISIBILITY_VISIBLE;
6714500be62dea3895a98336122a2944cc4ab024bc5George Mount
6724500be62dea3895a98336122a2944cc4ab024bc5George Mount        /**
673cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download is visible and shows in the notifications while
674cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * in progress and after completion.
675cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
6764500be62dea3895a98336122a2944cc4ab024bc5George Mount        public static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED =
677cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED;
678cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
679cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
680cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * This download doesn't show in the UI or in the notifications.
681cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         */
682cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        public static final int VISIBILITY_HIDDEN = DownloadManager.Request.VISIBILITY_HIDDEN;
683cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
684cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        /**
685cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn         * Constants related to HTTP request headers associated with each download.
6865506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn         */
6875506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn        public static class RequestHeaders {
6885506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn            public static final String HEADERS_DB_TABLE = "request_headers";
6895506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn            public static final String COLUMN_DOWNLOAD_ID = "download_id";
6905506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn            public static final String COLUMN_HEADER = "header";
6915506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn            public static final String COLUMN_VALUE = "value";
6925506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn
6935506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn            /**
6944500be62dea3895a98336122a2944cc4ab024bc5George Mount             * Path segment to add to a download URI to retrieve request headers
6955506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn             */
6965506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn            public static final String URI_SEGMENT = "headers";
6975506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn
6985506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn            /**
6995506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn             * Prefix for ContentValues keys that contain HTTP header lines, to be passed to
7004500be62dea3895a98336122a2944cc4ab024bc5George Mount             * DownloadProvider.insert().
701cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn             */
702cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            public static final String INSERT_KEY_PREFIX = "http_header_";
703cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
704cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
7055506618c80a292ac275d8b0c1046b446c7f58836Dianne Hackborn}
7064500be62dea3895a98336122a2944cc4ab024bc5George Mount