Re-enable task trimming

- Skip trimming tasks that are behind the home stack as they can not be
  returned to.
- Adding tag to event log when trimming the task to indicate it was trimmed
  by the recent tasks list
- Update tests to use task builder

Bug: 34270611
Test: Launch task from assistant, ensure that the assistant is not removed
Test: com.android.server.am.RecentTasksTest
Test: #testBackStackTasks_expectNoTrim
Test: #testBehindHomeStackTasks_expectTaskTrimmed
Test: #testOtherDisplayTasks_expectNoTrim
Change-Id: I538c9010f7ce7844bfa93ff3c8900dea6f91bc95
diff --git a/services/core/java/com/android/server/am/AppTaskImpl.java b/services/core/java/com/android/server/am/AppTaskImpl.java
index 17626ea..ab86dbdb 100644
--- a/services/core/java/com/android/server/am/AppTaskImpl.java
+++ b/services/core/java/com/android/server/am/AppTaskImpl.java
@@ -61,7 +61,7 @@
             try {
                 // We remove the task from recents to preserve backwards
                 if (!mService.mStackSupervisor.removeTaskByIdLocked(mTaskId, false,
-                        REMOVE_FROM_RECENTS)) {
+                        REMOVE_FROM_RECENTS, "finish-and-remove-task")) {
                     throw new IllegalArgumentException("Unable to find task ID " + mTaskId);
                 }
             } finally {