From 2e6672d1249a0fcb147632ecb97133d15076d9e8 Mon Sep 17 00:00:00 2001 From: Vasu Nori Date: Wed, 27 Oct 2010 11:47:25 -0700 Subject: 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 --- src/com/android/providers/downloads/DownloadReceiver.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/com') 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); -- cgit v1.2.3