From dd146332504492be65124e23dbb697841c904a96 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 3 Feb 2020 15:52:08 -0800 Subject: [PATCH] Remove workaround for starting app Bug: 141580748 Change-Id: I7760bc0ee07db6798153ff33566b48fcb3c39651 --- .../quickstep/FallbackRecentsTest.java | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java index bd2c539558..a726052e27 100644 --- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java +++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java @@ -147,7 +147,7 @@ public class FallbackRecentsTest { @Test @Ignore // b/143488140 public void goToOverviewFromApp() { - startAppFastAndWaitForRecentTask(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); + startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); mLauncher.getBackground().switchToOverview(); } @@ -182,8 +182,8 @@ public class FallbackRecentsTest { @Test @Ignore // b/143488140 public void testOverview() { - startAppFastAndWaitForRecentTask(getAppPackageName()); - startAppFastAndWaitForRecentTask(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); + startAppFast(getAppPackageName()); + startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); startTestActivity(2); Wait.atMost("Expected three apps in the task list", () -> mLauncher.getRecentTasks().size() >= 3, DEFAULT_ACTIVITY_TIMEOUT, mLauncher); @@ -236,25 +236,4 @@ public class FallbackRecentsTest { private int getTaskCount(RecentsActivity recents) { return recents.getOverviewPanel().getTaskViewCount(); } - - /** - * Workaround for b/141580748, there was an issue where the recent task is only updated when the - * activity starting the task is resumed. In this case, we should wait until the task is in - * the recents task list before continuing. - */ - private void startAppFastAndWaitForRecentTask(String packageName) { - startAppFast(packageName); - Wait.atMost("Expected app in task list", - () -> containsRecentTaskWithPackage(packageName), DEFAULT_ACTIVITY_TIMEOUT, - mLauncher); - } - - private boolean containsRecentTaskWithPackage(String packageName) { - for (ComponentName cn : mLauncher.getRecentTasks()) { - if (cn.getPackageName().equals(packageName)) { - return true; - } - } - return false; - } }