Re-adding the task to recents once task affinity updated

Task affinity was relinquished to another activity after the
task added to recent tasks, so there was nothing to trim when
the new task being added. Therefore, it ended up with many
duplicated recent tasks.

Bug: 223555529
Test: repeatedly setting wallpaper
Change-Id: Ib221daa4487c6000bdbf8c0cb0515d3132aacb95
This commit is contained in:
Louis Chang
2022-04-19 16:20:44 +08:00
parent 1b43c023fa
commit 8fdef46437

View File

@@ -1086,6 +1086,12 @@ class Task extends TaskFragment {
updateTaskDescription();
}
mSupportsPictureInPicture = info.supportsPictureInPicture();
// Re-adding the task to Recents once updated
if (inRecents) {
mTaskSupervisor.mRecentTasks.remove(this);
mTaskSupervisor.mRecentTasks.add(this);
}
}
/** Sets the original minimal width and height. */