diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2010-01-07 16:33:05 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2010-01-14 16:15:06 -0800 |
commit | 7dd92fa94df0a13b4592ee636b7aa2b605f6b473 (patch) | |
tree | c33e0e7a7b54fcda28add13c290e0a1b43be0368 /src/com/android/providers/downloads/DownloadReceiver.java | |
parent | 89ed5d0ede93be7664ebf4bc76029c5ec57e8a85 (diff) | |
download | android_packages_providers_DownloadProvider-7dd92fa94df0a13b4592ee636b7aa2b605f6b473.tar.gz android_packages_providers_DownloadProvider-7dd92fa94df0a13b4592ee636b7aa2b605f6b473.tar.bz2 android_packages_providers_DownloadProvider-7dd92fa94df0a13b4592ee636b7aa2b605f6b473.zip |
Use the private legacy API
The public API is getting deeply reworked for forward compatibility,
but since the Download Manager and the Browser need to continue using
the old API, a separate copy is being kept on the side.
Bug: 2245521
Change-Id: I85eff6ba9efc68600aa80e8dffa6720b0f2ed155
Diffstat (limited to 'src/com/android/providers/downloads/DownloadReceiver.java')
-rw-r--r-- | src/com/android/providers/downloads/DownloadReceiver.java | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/com/android/providers/downloads/DownloadReceiver.java b/src/com/android/providers/downloads/DownloadReceiver.java index 2065c649..e8f10e7d 100644 --- a/src/com/android/providers/downloads/DownloadReceiver.java +++ b/src/com/android/providers/downloads/DownloadReceiver.java @@ -86,22 +86,23 @@ public class DownloadReceiver extends BroadcastReceiver { intent.getData(), null, null, null, null); if (cursor != null) { if (cursor.moveToFirst()) { - int statusColumn = cursor.getColumnIndexOrThrow(Downloads.COLUMN_STATUS); + int statusColumn = cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_STATUS); int status = cursor.getInt(statusColumn); int visibilityColumn = - cursor.getColumnIndexOrThrow(Downloads.COLUMN_VISIBILITY); + cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_VISIBILITY); int visibility = cursor.getInt(visibilityColumn); - if (Downloads.isStatusCompleted(status) - && visibility == Downloads.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) { + if (Downloads.Impl.isStatusCompleted(status) + && visibility == Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) { ContentValues values = new ContentValues(); - values.put(Downloads.COLUMN_VISIBILITY, Downloads.VISIBILITY_VISIBLE); + values.put(Downloads.Impl.COLUMN_VISIBILITY, + Downloads.Impl.VISIBILITY_VISIBLE); context.getContentResolver().update(intent.getData(), values, null, null); } if (intent.getAction().equals(Constants.ACTION_OPEN)) { - int filenameColumn = cursor.getColumnIndexOrThrow(Downloads._DATA); + int filenameColumn = cursor.getColumnIndexOrThrow(Downloads.Impl._DATA); int mimetypeColumn = - cursor.getColumnIndexOrThrow(Downloads.COLUMN_MIME_TYPE); + cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_MIME_TYPE); String filename = cursor.getString(filenameColumn); String mimetype = cursor.getString(mimetypeColumn); Uri path = Uri.parse(filename); @@ -122,17 +123,18 @@ public class DownloadReceiver extends BroadcastReceiver { // swallow the exception entirely } } else { - int packageColumn = - cursor.getColumnIndexOrThrow(Downloads.COLUMN_NOTIFICATION_PACKAGE); - int classColumn = - cursor.getColumnIndexOrThrow(Downloads.COLUMN_NOTIFICATION_CLASS); + int packageColumn = cursor.getColumnIndexOrThrow( + Downloads.Impl.COLUMN_NOTIFICATION_PACKAGE); + int classColumn = cursor.getColumnIndexOrThrow( + Downloads.Impl.COLUMN_NOTIFICATION_CLASS); String pckg = cursor.getString(packageColumn); String clazz = cursor.getString(classColumn); if (pckg != null && clazz != null) { - Intent appIntent = new Intent(Downloads.ACTION_NOTIFICATION_CLICKED); + Intent appIntent = + new Intent(Downloads.Impl.ACTION_NOTIFICATION_CLICKED); appIntent.setClassName(pckg, clazz); if (intent.getBooleanExtra("multiple", true)) { - appIntent.setData(Downloads.CONTENT_URI); + appIntent.setData(Downloads.Impl.CONTENT_URI); } else { appIntent.setData(intent.getData()); } @@ -155,15 +157,16 @@ public class DownloadReceiver extends BroadcastReceiver { intent.getData(), null, null, null, null); if (cursor != null) { if (cursor.moveToFirst()) { - int statusColumn = cursor.getColumnIndexOrThrow(Downloads.COLUMN_STATUS); + int statusColumn = cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_STATUS); int status = cursor.getInt(statusColumn); int visibilityColumn = - cursor.getColumnIndexOrThrow(Downloads.COLUMN_VISIBILITY); + cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_VISIBILITY); int visibility = cursor.getInt(visibilityColumn); - if (Downloads.isStatusCompleted(status) - && visibility == Downloads.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) { + if (Downloads.Impl.isStatusCompleted(status) + && visibility == Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) { ContentValues values = new ContentValues(); - values.put(Downloads.COLUMN_VISIBILITY, Downloads.VISIBILITY_VISIBLE); + values.put(Downloads.Impl.COLUMN_VISIBILITY, + Downloads.Impl.VISIBILITY_VISIBLE); context.getContentResolver().update(intent.getData(), values, null, null); } } |