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

Commit 8ab700cb authored by Adam Powell's avatar Adam Powell
Browse files

Fix a bug in TaskStackBuilder where task stack PendingIntents would

not clear tasks properly.

Change-Id: I5a7918fa5e400c160409a45d3e00b32f6f4809aa
parent 818e7e9c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -206,7 +206,15 @@ public class TaskStackBuilder implements Iterable<Intent> {
     * @return The obtained PendingIntent
     */
    public PendingIntent getPendingIntent(int requestCode, int flags) {
        if (mIntents.isEmpty()) {
            throw new IllegalStateException(
                    "No intents added to TaskStackBuilder; cannot getPendingIntent");
        }

        Intent[] intents = mIntents.toArray(new Intent[mIntents.size()]);
        intents[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
                Intent.FLAG_ACTIVITY_CLEAR_TASK |
                Intent.FLAG_ACTIVITY_TASK_ON_HOME);
        return PendingIntent.getActivities(mSourceContext, requestCode, intents, flags);
    }
}