From 94ac0d7d3069adc5074945cec3d7d5f5a64b4e7a Mon Sep 17 00:00:00 2001 From: Ben Kwa Date: Wed, 15 Apr 2015 12:13:32 -0700 Subject: 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 --- packages/DocumentsUI/src/com/android/documentsui/CopyService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages') 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. -- cgit v1.1