From a0ad3ee07d2632e618c18ee62f2c210864665d5e Mon Sep 17 00:00:00 2001 From: Toby Kurien Date: Mon, 5 Oct 2015 18:15:10 +0200 Subject: [PATCH] Use correct downloadId when there are multiple Fixes #447. --- .../fdroid/fdroid/receiver/DownloadManagerReceiver.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/F-Droid/src/org/fdroid/fdroid/receiver/DownloadManagerReceiver.java b/F-Droid/src/org/fdroid/fdroid/receiver/DownloadManagerReceiver.java index 584c942d5..c88831706 100644 --- a/F-Droid/src/org/fdroid/fdroid/receiver/DownloadManagerReceiver.java +++ b/F-Droid/src/org/fdroid/fdroid/receiver/DownloadManagerReceiver.java @@ -62,13 +62,14 @@ public class DownloadManagerReceiver extends BroadcastReceiver { Intent appDetails = new Intent(context, AppDetails.class); appDetails.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); appDetails.setAction(intent.getAction()); - appDetails.putExtras(intent.getExtras()); + appDetails.putExtra(DownloadManager.EXTRA_DOWNLOAD_ID, downloadId); appDetails.putExtra(AppDetails.EXTRA_APPID, appId); + // set separate pending intents per download id PendingIntent pi = PendingIntent.getActivity( - context, 1, appDetails, PendingIntent.FLAG_ONE_SHOT); + context, (int) downloadId, appDetails, PendingIntent.FLAG_ONE_SHOT); - // launch LocalRepoActivity if the user selects this notification + // build & show notification String downloadTitle = AsyncDownloaderFromAndroid.getDownloadTitle(context, downloadId); Notification notif = new NotificationCompat.Builder(context) .setContentTitle(downloadTitle)