diff options
author | Danny Baumann <dannybaumann@web.de> | 2013-04-03 14:36:21 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2013-04-05 09:35:18 +0200 |
commit | 459fc32974f03d27a7b70ea8acadbc44e2360f11 (patch) | |
tree | 762b9357aeba58dcdf0a1dbb5f061e72c4eedc65 /src/com/android | |
parent | 58fe9af8ab11e2f0ef08c7aba09f075a7c09e069 (diff) | |
download | android_packages_providers_DownloadProvider-cm-10.1.0-RC5.tar.gz android_packages_providers_DownloadProvider-cm-10.1.0-RC5.tar.bz2 android_packages_providers_DownloadProvider-cm-10.1.0-RC5.zip |
Fix download notification click behaviour.cm-10.1.3-RC2cm-10.1.3-RC1cm-10.1.3cm-10.1.2cm-10.1.1cm-10.1.0-RC5cm-10.1.0-RC4cm-10.1.0-RC3cm-10.1.0-RC2cm-10.1.0-RC1cm-10.1.0cm-10.1-M3cm-10.1
PendingIntent.getBroadcast() doesn't update the intent extras if not
explicitly given something to distinguish the intents. This caused the
notification on-click to do nothing on everything but the first
download.
Change-Id: Ie69459c8bd31922133d7d1d130b2835c84e6037a
JIRA:CYAN-756
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/providers/downloads/DownloadNotifier.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/providers/downloads/DownloadNotifier.java b/src/com/android/providers/downloads/DownloadNotifier.java index daae7831..f3878654 100644 --- a/src/com/android/providers/downloads/DownloadNotifier.java +++ b/src/com/android/providers/downloads/DownloadNotifier.java @@ -126,11 +126,14 @@ public class DownloadNotifier { // Build action intents if (type == TYPE_ACTIVE || type == TYPE_WAITING) { + // build a synthetic uri for intent identification purposes + final Uri uri = new Uri.Builder().scheme("active-dl").appendPath(tag).build(); final Intent intent = new Intent(Constants.ACTION_LIST, - null, mContext, DownloadReceiver.class); + 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_UPDATE_CURRENT)); builder.setOngoing(true); } else if (type == TYPE_COMPLETE) { @@ -152,7 +155,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_UPDATE_CURRENT)); final Intent hideIntent = new Intent(Constants.ACTION_HIDE, uri, mContext, DownloadReceiver.class); |