Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94ac0d7d authored by Ben Kwa's avatar Ben Kwa
Browse files

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
parent aaa29705
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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.