diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-04-05 13:35:11 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-04-05 13:35:11 -0700 |
commit | 90455b3d2489ab5a9a8c2fca23f2a7c05d105235 (patch) | |
tree | 6c9f1a6b140c40bc1b3cb0d8fe12412c96353f36 | |
parent | 445b908259dac16f32664521c77d94959db7ded3 (diff) | |
parent | 82d26295ca202bdcbb56343117fd450a2b7097c0 (diff) | |
download | android_packages_providers_DownloadProvider-90455b3d2489ab5a9a8c2fca23f2a7c05d105235.tar.gz android_packages_providers_DownloadProvider-90455b3d2489ab5a9a8c2fca23f2a7c05d105235.tar.bz2 android_packages_providers_DownloadProvider-90455b3d2489ab5a9a8c2fca23f2a7c05d105235.zip |
am 82d26295: Merge commit \'ab2d11fa\' into merge2
* commit '82d26295ca202bdcbb56343117fd450a2b7097c0':
Fix download notification click behaviour.
-rw-r--r-- | src/com/android/providers/downloads/DownloadNotifier.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/providers/downloads/DownloadNotifier.java b/src/com/android/providers/downloads/DownloadNotifier.java index df0bf840..04054783 100644 --- a/src/com/android/providers/downloads/DownloadNotifier.java +++ b/src/com/android/providers/downloads/DownloadNotifier.java @@ -161,12 +161,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, PendingIntent.FLAG_CANCEL_CURRENT)); + builder.setContentIntent(PendingIntent.getBroadcast(mContext, + 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); builder.setOngoing(true); } else if (type == TYPE_COMPLETE) { @@ -188,8 +190,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, PendingIntent.FLAG_CANCEL_CURRENT)); + builder.setContentIntent(PendingIntent.getBroadcast(mContext, + 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); final Intent hideIntent = new Intent(Constants.ACTION_HIDE, uri, mContext, DownloadReceiver.class); |