summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-04-05 18:12:01 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-04-05 18:12:01 +0000
commitab2d11faa4bfe73f21ecd13507cfb694b84a4964 (patch)
treec5ecff9af8efa5f3d817b192e7ade469722e3f79
parent9f48387a1cf8116b8aba3035fbb1f0aec4cf0861 (diff)
parent606590999542bcd3ac7d9e95022396503133920c (diff)
downloadandroid_packages_providers_DownloadProvider-ab2d11faa4bfe73f21ecd13507cfb694b84a4964.tar.gz
android_packages_providers_DownloadProvider-ab2d11faa4bfe73f21ecd13507cfb694b84a4964.tar.bz2
android_packages_providers_DownloadProvider-ab2d11faa4bfe73f21ecd13507cfb694b84a4964.zip
Merge "Fix download notification click behaviour."
-rw-r--r--src/com/android/providers/downloads/DownloadNotifier.java10
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);