Fix flaky test ActivityManagerTest#testServiceDoneLRUPosition

Bug: 183289589
Test: CtsAppTestCases:ActivityManagerTest#testServiceDoneLRUPosition
Change-Id: I2615e578ac1fe35acb9d074062bb57d0acd31292
diff --git a/tests/app/src/android/app/cts/ActivityManagerTest.java b/tests/app/src/android/app/cts/ActivityManagerTest.java
index e2af20b..e38c925 100644
--- a/tests/app/src/android/app/cts/ActivityManagerTest.java
+++ b/tests/app/src/android/app/cts/ActivityManagerTest.java
@@ -1577,6 +1577,9 @@
                     PACKAGE_NAME_APP3, PACKAGE_NAME_APP3, 0, null);
             watcher3.waitFor(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY, null);
 
+            // Launch home so we'd have cleared these the above test activities from recents.
+            launchHome();
+
             // Now stop the foreground service, we'd have to do via the controller interface
             final Message msg = Message.obtain();
             try {