diff options
author | Ben Kwa <kenobi@google.com> | 2015-04-15 12:13:32 -0700 |
---|---|---|
committer | Ben Kwa <kenobi@google.com> | 2015-04-16 09:43:41 -0700 |
commit | 94ac0d7d3069adc5074945cec3d7d5f5a64b4e7a (patch) | |
tree | 2ec3849bdf579a884694b330f46539863b95208c /packages/DocumentsUI/src | |
parent | aaa297056503064eadfa15d9b4fd416f7a35f631 (diff) | |
download | frameworks_base-94ac0d7d3069adc5074945cec3d7d5f5a64b4e7a.zip frameworks_base-94ac0d7d3069adc5074945cec3d7d5f5a64b4e7a.tar.gz frameworks_base-94ac0d7d3069adc5074945cec3d7d5f5a64b4e7a.tar.bz2 |
Fix cancellation of copy jobs.
Add FLAG_CANCEL_CURRENT to the pending intent for cancellation, to
prevent reuse of previously created cancellation intents. Previously
created intents have non-matching job IDs, which causes the cancellation
intent to be ignored.
BUG=20221969
Change-Id: Ie0afcc6af53a550b44bc4b2f3d48942cdb092a65
Diffstat (limited to 'packages/DocumentsUI/src')
-rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/CopyService.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/CopyService.java b/packages/DocumentsUI/src/com/android/documentsui/CopyService.java index d2ef3d7..a9f03b6 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/CopyService.java +++ b/packages/DocumentsUI/src/com/android/documentsui/CopyService.java @@ -191,7 +191,8 @@ public class CopyService extends IntentService { cancelIntent.putExtra(EXTRA_CANCEL, mJobId); mProgressBuilder.addAction(R.drawable.ic_cab_cancel, getString(android.R.string.cancel), PendingIntent.getService(this, 0, - cancelIntent, PendingIntent.FLAG_ONE_SHOT)); + cancelIntent, + PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_CANCEL_CURRENT)); // Send an initial progress notification. mProgressBuilder.setProgress(0, 0, true); // Indeterminate progress while setting up. |