Update old stack check for finding recent task index to remove

- The recents task list was previously checking the stack of the task to
  optimize finding similar tasks to remove. In P, each task generally has
  its own stack, so this check is invalid. Instead, we should check the
  activity type to skip early if the activity types don't match.
- Add another test to ensure that when a new multiple-task non-document
  task is added, that it will replace any existing matching task

Bug: 72476837
Test: atest FrameworksServicesTests:RecentTasksTest

Change-Id: I457fd5b2cd6dd1eb5e2533912df7e3948e0366b1
Signed-off-by: Winson Chung <winsonc@google.com>
2 files changed