From 5048492e352be8134d92178d757a60117491e292 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 26 Mar 2013 13:15:43 -0700 Subject: New PendingIntents when extras change. Otherwise notifications end up launching with stale download IDs. Bug: 8417220 Change-Id: Ie72a2f4ac7b72213678ac6001af45709034492dd --- src/com/android/providers/downloads/DownloadNotifier.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/providers/downloads/DownloadNotifier.java b/src/com/android/providers/downloads/DownloadNotifier.java index f832eae3..df0bf840 100644 --- a/src/com/android/providers/downloads/DownloadNotifier.java +++ b/src/com/android/providers/downloads/DownloadNotifier.java @@ -165,7 +165,8 @@ public class DownloadNotifier { null, mContext, DownloadReceiver.class); intent.putExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS, getDownloadIds(cluster)); - builder.setContentIntent(PendingIntent.getBroadcast(mContext, 0, intent, 0)); + builder.setContentIntent(PendingIntent.getBroadcast( + mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)); builder.setOngoing(true); } else if (type == TYPE_COMPLETE) { @@ -187,7 +188,8 @@ public class DownloadNotifier { final Intent intent = new Intent(action, uri, mContext, DownloadReceiver.class); intent.putExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS, getDownloadIds(cluster)); - builder.setContentIntent(PendingIntent.getBroadcast(mContext, 0, intent, 0)); + builder.setContentIntent(PendingIntent.getBroadcast( + mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)); final Intent hideIntent = new Intent(Constants.ACTION_HIDE, uri, mContext, DownloadReceiver.class); -- cgit v1.2.3