From 87fbd33a3702bc77a68a824dd1e36d4010574767 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 12 Jun 2019 15:26:27 -0700 Subject: [PATCH] Not using settings app in tests Change-Id: I7542dab07a0d5a76cc90f4b5eee0d376b5d8ca11 --- .../tests/src/com/android/quickstep/FallbackRecentsTest.java | 3 ++- tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java index 20fdff2c55..013591171c 100644 --- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java +++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java @@ -22,6 +22,7 @@ import static androidx.test.InstrumentationRegistry.getInstrumentation; import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS; import static com.android.launcher3.tapl.TestHelpers.getHomeIntentInPackage; import static com.android.launcher3.tapl.TestHelpers.getLauncherInMyProcess; +import static com.android.launcher3.ui.AbstractLauncherUiTest.resolveSystemApp; import static com.android.launcher3.util.rule.ShellCommandRule.disableHeadsUpNotification; import static com.android.launcher3.util.rule.ShellCommandRule.getLauncherCommand; import static com.android.quickstep.NavigationModeSwitchRule.Mode.THREE_BUTTON; @@ -108,7 +109,7 @@ public class FallbackRecentsTest { @NavigationModeSwitch(mode = THREE_BUTTON) @Test public void goToOverviewFromApp() { - startAppFast("com.android.settings"); + startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); mLauncher.getBackground().switchToOverview(); } diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 64fe2d7d79..abc93cd4b7 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -395,7 +395,7 @@ public abstract class AbstractLauncherUiTest { DEFAULT_UI_TIMEOUT)); } - protected static String resolveSystemApp(String category) { + public static String resolveSystemApp(String category) { return getInstrumentation().getContext().getPackageManager().resolveActivity( new Intent(Intent.ACTION_MAIN).addCategory(category), PackageManager.MATCH_SYSTEM_ONLY).