summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/DownloadReceiver.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/DownloadReceiver.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/DownloadReceiver.java')
-rw-r--r--src/com/android/providers/downloads/DownloadReceiver.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/com/android/providers/downloads/DownloadReceiver.java b/src/com/android/providers/downloads/DownloadReceiver.java
index 73eb0941..c0ccad3a 100644
--- a/src/com/android/providers/downloads/DownloadReceiver.java
+++ b/src/com/android/providers/downloads/DownloadReceiver.java
@@ -71,20 +71,22 @@ public class DownloadReceiver extends BroadcastReceiver {
intent.getData(), null, null, null, null);
if (cursor != null) {
if (cursor.moveToFirst()) {
- int statusColumn = cursor.getColumnIndexOrThrow(Downloads.STATUS);
+ int statusColumn = cursor.getColumnIndexOrThrow(Downloads.COLUMN_STATUS);
int status = cursor.getInt(statusColumn);
- int visibilityColumn = cursor.getColumnIndexOrThrow(Downloads.VISIBILITY);
+ int visibilityColumn =
+ cursor.getColumnIndexOrThrow(Downloads.COLUMN_VISIBILITY);
int visibility = cursor.getInt(visibilityColumn);
if (Downloads.isStatusCompleted(status)
&& visibility == Downloads.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) {
ContentValues values = new ContentValues();
- values.put(Downloads.VISIBILITY, Downloads.VISIBILITY_VISIBLE);
+ values.put(Downloads.COLUMN_VISIBILITY, Downloads.VISIBILITY_VISIBLE);
context.getContentResolver().update(intent.getData(), values, null, null);
}
if (intent.getAction().equals(Constants.ACTION_OPEN)) {
int filenameColumn = cursor.getColumnIndexOrThrow(Downloads._DATA);
- int mimetypeColumn = cursor.getColumnIndexOrThrow(Downloads.MIMETYPE);
+ int mimetypeColumn =
+ cursor.getColumnIndexOrThrow(Downloads.COLUMN_MIME_TYPE);
String filename = cursor.getString(filenameColumn);
String mimetype = cursor.getString(mimetypeColumn);
Uri path = Uri.parse(filename);
@@ -106,13 +108,13 @@ public class DownloadReceiver extends BroadcastReceiver {
}
} else {
int packageColumn =
- cursor.getColumnIndexOrThrow(Downloads.NOTIFICATION_PACKAGE);
+ cursor.getColumnIndexOrThrow(Downloads.COLUMN_NOTIFICATION_PACKAGE);
int classColumn =
- cursor.getColumnIndexOrThrow(Downloads.NOTIFICATION_CLASS);
+ cursor.getColumnIndexOrThrow(Downloads.COLUMN_NOTIFICATION_CLASS);
String pckg = cursor.getString(packageColumn);
String clazz = cursor.getString(classColumn);
if (pckg != null && clazz != null) {
- Intent appIntent = new Intent(Downloads.NOTIFICATION_CLICKED_ACTION);
+ Intent appIntent = new Intent(Downloads.ACTION_NOTIFICATION_CLICKED);
appIntent.setClassName(pckg, clazz);
if (intent.getBooleanExtra("multiple", true)) {
appIntent.setData(Downloads.CONTENT_URI);
@@ -138,14 +140,15 @@ public class DownloadReceiver extends BroadcastReceiver {
intent.getData(), null, null, null, null);
if (cursor != null) {
if (cursor.moveToFirst()) {
- int statusColumn = cursor.getColumnIndexOrThrow(Downloads.STATUS);
+ int statusColumn = cursor.getColumnIndexOrThrow(Downloads.COLUMN_STATUS);
int status = cursor.getInt(statusColumn);
- int visibilityColumn = cursor.getColumnIndexOrThrow(Downloads.VISIBILITY);
+ int visibilityColumn =
+ cursor.getColumnIndexOrThrow(Downloads.COLUMN_VISIBILITY);
int visibility = cursor.getInt(visibilityColumn);
if (Downloads.isStatusCompleted(status)
&& visibility == Downloads.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) {
ContentValues values = new ContentValues();
- values.put(Downloads.VISIBILITY, Downloads.VISIBILITY_VISIBLE);
+ values.put(Downloads.COLUMN_VISIBILITY, Downloads.VISIBILITY_VISIBLE);
context.getContentResolver().update(intent.getData(), values, null, null);
}
}