Cleanup activity and task creation in unit tests.

This changelist replaces static methods used to create activity and
tasks with builders so that they can be extended in the future. This
change also removes the static default component names.

Bug: 64750076
Test: bit FrameworksServicesTests:com.android.server.am.ActivityRecordTests
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackTests
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStarterTests
Test: bit FrameworksServicesTests:com.android.server.am.LaunchBoundsTests
Test: bit FrameworksServicesTests:com.android.server.am.LaunchingActivityPositionerTests
Test: bit FrameworksServicesTests:com.android.server.am.LaunchingTaskPositionerTests
Test: bit FrameworksServicesTests:com.android.server.am.LaunchingBoundsControllerTests
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
Change-Id: I389536b1dd618d4f80b5073ded7aeaacbab39cac
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
index 026abce..5b1e4b7 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityStarterTests.java
@@ -50,9 +50,6 @@
 @Presubmit
 @RunWith(AndroidJUnit4.class)
 public class ActivityStarterTests extends ActivityTestsBase {
-    private static final ComponentName testActivityComponent =
-            ComponentName.unflattenFromString("com.foo/.BarActivity");
-
     private ActivityManagerService mService;
     private ActivityStarter mStarter;
 
@@ -66,9 +63,10 @@
     @Test
     public void testUpdateLaunchBounds() throws Exception {
         // When in a non-resizeable stack, the task bounds should be updated.
-        final TaskRecord task = createTask(mService.mStackSupervisor, testActivityComponent,
-                mService.mStackSupervisor.getDefaultDisplay().createStack(
-                        WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD, true /* onTop */));
+        final TaskRecord task = new TaskBuilder(mService.mStackSupervisor)
+                .setStack(mService.mStackSupervisor.getDefaultDisplay().createStack(
+                        WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD, true /* onTop */))
+                .build();
         final Rect bounds = new Rect(10, 10, 100, 100);
 
         mStarter.updateBounds(task, bounds);
@@ -76,9 +74,10 @@
         assertEquals(task.getStack().mBounds, null);
 
         // When in a resizeable stack, the stack bounds should be updated as well.
-        final TaskRecord task2 = createTask(mService.mStackSupervisor, testActivityComponent,
-                mService.mStackSupervisor.getDefaultDisplay().createStack(
-                        WINDOWING_MODE_PINNED, ACTIVITY_TYPE_STANDARD, true /* onTop */));
+        final TaskRecord task2 = new TaskBuilder(mService.mStackSupervisor)
+                .setStack(mService.mStackSupervisor.getDefaultDisplay().createStack(
+                        WINDOWING_MODE_PINNED, ACTIVITY_TYPE_STANDARD, true /* onTop */))
+                .build();
         assertTrue(task2.getStack() instanceof PinnedActivityStack);
         mStarter.updateBounds(task2, bounds);