Loading tests/tapl/com/android/launcher3/tapl/AllApps.java +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { @NonNull public AppIcon getAppIcon(String appName) { final UiObject2 allAppsContainer = verifyActiveContainer(); final BySelector appIconSelector = AppIcon.getAppIconSelector(appName); final BySelector appIconSelector = AppIcon.getAppIconSelector(appName, mLauncher); if (!allAppsContainer.hasObject(appIconSelector)) { scrollBackToBeginning(); int attempts = 0; Loading tests/tapl/com/android/launcher3/tapl/AppIcon.java +2 −2 Original line number Diff line number Diff line Loading @@ -31,8 +31,8 @@ public final class AppIcon extends Launchable { super(launcher, icon); } static BySelector getAppIconSelector(String appName) { return By.clazz(TextView.class).text(appName).pkg(LauncherInstrumentation.LAUNCHER_PKG); static BySelector getAppIconSelector(String appName, LauncherInstrumentation launcher) { return By.clazz(TextView.class).text(appName).pkg(launcher.mLauncherPackageName); } /** Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +4 −4 Original line number Diff line number Diff line Loading @@ -16,13 +16,13 @@ package com.android.launcher3.tapl; import java.util.Collections; import java.util.List; import androidx.annotation.NonNull; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; import java.util.Collections; import java.util.List; /** * Common overview pane for both Launcher and fallback recents */ Loading Loading @@ -69,7 +69,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { public OverviewTask getCurrentTask() { verifyActiveContainer(); final List<UiObject2> taskViews = mLauncher.getDevice().findObjects( LauncherInstrumentation.getLauncherObjectSelector("snapshot")); mLauncher.getLauncherObjectSelector("snapshot")); LauncherInstrumentation.assertNotEquals("Unable to find a task", 0, taskViews.size()); // taskViews contains up to 3 task views: the 'main' (having the widest visible Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +4 −3 Original line number Diff line number Diff line Loading @@ -83,13 +83,13 @@ public final class LauncherInstrumentation { private static final String APPS_RES_ID = "apps_view"; private static final String OVERVIEW_RES_ID = "overview_panel"; private static final String WIDGETS_RES_ID = "widgets_list_view"; static final String LAUNCHER_PKG = "com.google.android.apps.nexuslauncher"; public static final int WAIT_TIME_MS = 60000; private static final String SYSTEMUI_PACKAGE = "com.android.systemui"; private static WeakReference<VisibleContainer> sActiveContainer = new WeakReference<>(null); private final UiDevice mDevice; final String mLauncherPackageName; private final boolean mSwipeUpEnabled; private Boolean mSwipeUpEnabledOverride = null; private final Instrumentation mInstrumentation; Loading @@ -101,6 +101,7 @@ public final class LauncherInstrumentation { public LauncherInstrumentation(Instrumentation instrumentation) { mInstrumentation = instrumentation; mDevice = UiDevice.getInstance(instrumentation); mLauncherPackageName = mDevice.getLauncherPackageName(); final boolean swipeUpEnabledDefault = !SwipeUpSetting.isSwipeUpSettingAvailable() || SwipeUpSetting.isSwipeUpEnabledDefaultValue(); Loading Loading @@ -385,8 +386,8 @@ public final class LauncherInstrumentation { return object; } static BySelector getLauncherObjectSelector(String resName) { return By.res(LAUNCHER_PKG, resName); BySelector getLauncherObjectSelector(String resName) { return By.res(mLauncherPackageName, resName); } @NonNull Loading tests/tapl/com/android/launcher3/tapl/Workspace.java +3 −3 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public final class Workspace extends Home { @Nullable public AppIcon tryGetWorkspaceAppIcon(String appName) { final UiObject2 workspace = verifyActiveContainer(); final UiObject2 icon = workspace.findObject(AppIcon.getAppIconSelector(appName)); final UiObject2 icon = workspace.findObject(AppIcon.getAppIconSelector(appName, mLauncher)); return icon != null ? new AppIcon(mLauncher, icon) : null; } Loading @@ -85,7 +85,7 @@ public final class Workspace extends Home { return new AppIcon(mLauncher, mLauncher.getObjectInContainer( verifyActiveContainer(), AppIcon.getAppIconSelector(appName))); AppIcon.getAppIconSelector(appName, mLauncher))); } /** Loading @@ -108,7 +108,7 @@ public final class Workspace extends Home { @NonNull private AppIcon getHotseatAppIcon(String appName) { return new AppIcon(mLauncher, mLauncher.getObjectInContainer( mHotseat, AppIcon.getAppIconSelector(appName))); mHotseat, AppIcon.getAppIconSelector(appName, mLauncher))); } private void dragIconToNextScreen(AppIcon app, UiObject2 workspace) { Loading Loading
tests/tapl/com/android/launcher3/tapl/AllApps.java +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { @NonNull public AppIcon getAppIcon(String appName) { final UiObject2 allAppsContainer = verifyActiveContainer(); final BySelector appIconSelector = AppIcon.getAppIconSelector(appName); final BySelector appIconSelector = AppIcon.getAppIconSelector(appName, mLauncher); if (!allAppsContainer.hasObject(appIconSelector)) { scrollBackToBeginning(); int attempts = 0; Loading
tests/tapl/com/android/launcher3/tapl/AppIcon.java +2 −2 Original line number Diff line number Diff line Loading @@ -31,8 +31,8 @@ public final class AppIcon extends Launchable { super(launcher, icon); } static BySelector getAppIconSelector(String appName) { return By.clazz(TextView.class).text(appName).pkg(LauncherInstrumentation.LAUNCHER_PKG); static BySelector getAppIconSelector(String appName, LauncherInstrumentation launcher) { return By.clazz(TextView.class).text(appName).pkg(launcher.mLauncherPackageName); } /** Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +4 −4 Original line number Diff line number Diff line Loading @@ -16,13 +16,13 @@ package com.android.launcher3.tapl; import java.util.Collections; import java.util.List; import androidx.annotation.NonNull; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; import java.util.Collections; import java.util.List; /** * Common overview pane for both Launcher and fallback recents */ Loading Loading @@ -69,7 +69,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { public OverviewTask getCurrentTask() { verifyActiveContainer(); final List<UiObject2> taskViews = mLauncher.getDevice().findObjects( LauncherInstrumentation.getLauncherObjectSelector("snapshot")); mLauncher.getLauncherObjectSelector("snapshot")); LauncherInstrumentation.assertNotEquals("Unable to find a task", 0, taskViews.size()); // taskViews contains up to 3 task views: the 'main' (having the widest visible Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +4 −3 Original line number Diff line number Diff line Loading @@ -83,13 +83,13 @@ public final class LauncherInstrumentation { private static final String APPS_RES_ID = "apps_view"; private static final String OVERVIEW_RES_ID = "overview_panel"; private static final String WIDGETS_RES_ID = "widgets_list_view"; static final String LAUNCHER_PKG = "com.google.android.apps.nexuslauncher"; public static final int WAIT_TIME_MS = 60000; private static final String SYSTEMUI_PACKAGE = "com.android.systemui"; private static WeakReference<VisibleContainer> sActiveContainer = new WeakReference<>(null); private final UiDevice mDevice; final String mLauncherPackageName; private final boolean mSwipeUpEnabled; private Boolean mSwipeUpEnabledOverride = null; private final Instrumentation mInstrumentation; Loading @@ -101,6 +101,7 @@ public final class LauncherInstrumentation { public LauncherInstrumentation(Instrumentation instrumentation) { mInstrumentation = instrumentation; mDevice = UiDevice.getInstance(instrumentation); mLauncherPackageName = mDevice.getLauncherPackageName(); final boolean swipeUpEnabledDefault = !SwipeUpSetting.isSwipeUpSettingAvailable() || SwipeUpSetting.isSwipeUpEnabledDefaultValue(); Loading Loading @@ -385,8 +386,8 @@ public final class LauncherInstrumentation { return object; } static BySelector getLauncherObjectSelector(String resName) { return By.res(LAUNCHER_PKG, resName); BySelector getLauncherObjectSelector(String resName) { return By.res(mLauncherPackageName, resName); } @NonNull Loading
tests/tapl/com/android/launcher3/tapl/Workspace.java +3 −3 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public final class Workspace extends Home { @Nullable public AppIcon tryGetWorkspaceAppIcon(String appName) { final UiObject2 workspace = verifyActiveContainer(); final UiObject2 icon = workspace.findObject(AppIcon.getAppIconSelector(appName)); final UiObject2 icon = workspace.findObject(AppIcon.getAppIconSelector(appName, mLauncher)); return icon != null ? new AppIcon(mLauncher, icon) : null; } Loading @@ -85,7 +85,7 @@ public final class Workspace extends Home { return new AppIcon(mLauncher, mLauncher.getObjectInContainer( verifyActiveContainer(), AppIcon.getAppIconSelector(appName))); AppIcon.getAppIconSelector(appName, mLauncher))); } /** Loading @@ -108,7 +108,7 @@ public final class Workspace extends Home { @NonNull private AppIcon getHotseatAppIcon(String appName) { return new AppIcon(mLauncher, mLauncher.getObjectInContainer( mHotseat, AppIcon.getAppIconSelector(appName))); mHotseat, AppIcon.getAppIconSelector(appName, mLauncher))); } private void dragIconToNextScreen(AppIcon app, UiObject2 workspace) { Loading