summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-10-27 11:47:25 -0700
committerVasu Nori <vnori@google.com>2010-11-01 13:28:09 -0700
commit2e6672d1249a0fcb147632ecb97133d15076d9e8 (patch)
tree8376787dce4e79ec29dcbab88a7bf4a7201fc6be /src
parentb3ae94915d68e4c3f325ea02bab32d00cccb4f1a (diff)
downloadandroid_packages_providers_DownloadProvider-2e6672d1249a0fcb147632ecb97133d15076d9e8.tar.gz
android_packages_providers_DownloadProvider-2e6672d1249a0fcb147632ecb97133d15076d9e8.tar.bz2
android_packages_providers_DownloadProvider-2e6672d1249a0fcb147632ecb97133d15076d9e8.zip
in DM public API, sending notifications on clicks should include data
receiving application needs to know WHAT items the clicks occurred on - not just the fact that *something* was clicked on. this is duplicating the behavior as it exists today in the non-public API. depends on Change-Id: Ibe53ccd9934c73175459e42e3d417eee69ae6735 Change-Id: I924f85bd5faf443ac5648839b68390ec4de1f677
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/downloads/DownloadReceiver.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadReceiver.java b/src/com/android/providers/downloads/DownloadReceiver.java
index 2cb6aba4..33066393 100644
--- a/src/com/android/providers/downloads/DownloadReceiver.java
+++ b/src/com/android/providers/downloads/DownloadReceiver.java
@@ -170,11 +170,21 @@ public class DownloadReceiver extends BroadcastReceiver {
if (isPublicApi) {
appIntent = new Intent(DownloadManager.ACTION_NOTIFICATION_CLICKED);
appIntent.setPackage(pckg);
+ // send id of the items clicked on.
+ if (intent.getBooleanExtra("multiple", false)) {
+ // broadcast received saying click occurred on a notification with multiple titles.
+ // don't include any ids at all - let the caller query all downloads belonging to it
+ // TODO modify the broadcast to include ids of those multiple notifications.
+ } else {
+ appIntent.putExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS,
+ new long[] {
+ cursor.getLong(cursor.getColumnIndexOrThrow(Downloads.Impl._ID))});
+ }
} else { // legacy behavior
if (clazz == null) {
return;
}
- appIntent = new Intent(Downloads.Impl.ACTION_NOTIFICATION_CLICKED);
+ appIntent = new Intent(DownloadManager.ACTION_NOTIFICATION_CLICKED);
appIntent.setClassName(pckg, clazz);
if (intent.getBooleanExtra("multiple", true)) {
appIntent.setData(Downloads.Impl.CONTENT_URI);