summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/DownloadThread.java
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-01-20 11:05:32 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-01-21 08:46:48 -0800
commit59910f4a9ce953ea74c8db759448f227c96796b3 (patch)
treee4ac3bea09d04b32c6280b77163aa5696ffe5bed /src/com/android/providers/downloads/DownloadThread.java
parentc6f5aad265cfc36a64cd2bdb5adf3cc9736bbd80 (diff)
downloadandroid_packages_providers_DownloadProvider-59910f4a9ce953ea74c8db759448f227c96796b3.tar.gz
android_packages_providers_DownloadProvider-59910f4a9ce953ea74c8db759448f227c96796b3.tar.bz2
android_packages_providers_DownloadProvider-59910f4a9ce953ea74c8db759448f227c96796b3.zip
Use the new download manager APIs introduced in change 7400
Diffstat (limited to 'src/com/android/providers/downloads/DownloadThread.java')
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java
index 6e72b422..127cc46d 100644
--- a/src/com/android/providers/downloads/DownloadThread.java
+++ b/src/com/android/providers/downloads/DownloadThread.java
@@ -429,13 +429,13 @@ http_request_loop:
values.put(Constants.ETAG, headerETag);
}
if (mimeType != null) {
- values.put(Downloads.MIMETYPE, mimeType);
+ values.put(Downloads.COLUMN_MIME_TYPE, mimeType);
}
int contentLength = -1;
if (headerContentLength != null) {
contentLength = Integer.parseInt(headerContentLength);
}
- values.put(Downloads.TOTAL_BYTES, contentLength);
+ values.put(Downloads.COLUMN_TOTAL_BYTES, contentLength);
mContext.getContentResolver().update(contentUri, values, null, null);
}
@@ -470,7 +470,7 @@ http_request_loop:
bytesRead = entityStream.read(data);
} catch (IOException ex) {
ContentValues values = new ContentValues();
- values.put(Downloads.CURRENT_BYTES, bytesSoFar);
+ values.put(Downloads.COLUMN_CURRENT_BYTES, bytesSoFar);
mContext.getContentResolver().update(contentUri, values, null, null);
if (!mInfo.mNoIntegrity && headerETag == null) {
if (Constants.LOGV) {
@@ -505,9 +505,9 @@ http_request_loop:
}
if (bytesRead == -1) { // success
ContentValues values = new ContentValues();
- values.put(Downloads.CURRENT_BYTES, bytesSoFar);
+ values.put(Downloads.COLUMN_CURRENT_BYTES, bytesSoFar);
if (headerContentLength == null) {
- values.put(Downloads.TOTAL_BYTES, bytesSoFar);
+ values.put(Downloads.COLUMN_TOTAL_BYTES, bytesSoFar);
}
mContext.getContentResolver().update(contentUri, values, null, null);
if ((headerContentLength != null)
@@ -577,7 +577,7 @@ http_request_loop:
&& now - timeLastNotification
> Constants.MIN_PROGRESS_TIME) {
ContentValues values = new ContentValues();
- values.put(Downloads.CURRENT_BYTES, bytesSoFar);
+ values.put(Downloads.COLUMN_CURRENT_BYTES, bytesSoFar);
mContext.getContentResolver().update(
contentUri, values, null, null);
bytesNotified = bytesSoFar;
@@ -696,13 +696,13 @@ http_request_loop:
int status, boolean countRetry, int retryAfter, int redirectCount, boolean gotData,
String filename, String uri, String mimeType) {
ContentValues values = new ContentValues();
- values.put(Downloads.STATUS, status);
+ values.put(Downloads.COLUMN_STATUS, status);
values.put(Downloads._DATA, filename);
if (uri != null) {
- values.put(Downloads.URI, uri);
+ values.put(Downloads.COLUMN_URI, uri);
}
- values.put(Downloads.MIMETYPE, mimeType);
- values.put(Downloads.LAST_MODIFICATION, System.currentTimeMillis());
+ values.put(Downloads.COLUMN_MIME_TYPE, mimeType);
+ values.put(Downloads.COLUMN_LAST_MODIFICATION, System.currentTimeMillis());
values.put(Constants.RETRY_AFTER_X_REDIRECT_COUNT, retryAfter + (redirectCount << 28));
if (!countRetry) {
values.put(Constants.FAILED_CONNECTIONS, 0);