summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/DownloadReceiver.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/providers/downloads/DownloadReceiver.java')
-rw-r--r--src/com/android/providers/downloads/DownloadReceiver.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadReceiver.java b/src/com/android/providers/downloads/DownloadReceiver.java
index c41895b9..33066393 100644
--- a/src/com/android/providers/downloads/DownloadReceiver.java
+++ b/src/com/android/providers/downloads/DownloadReceiver.java
@@ -41,6 +41,7 @@ public class DownloadReceiver extends BroadcastReceiver {
@VisibleForTesting
SystemFacade mSystemFacade = null;
+ @Override
public void onReceive(Context context, Intent intent) {
if (mSystemFacade == null) {
mSystemFacade = new RealSystemFacade(context);
@@ -169,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);