Loading quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +1 −5 Original line number Original line Diff line number Diff line Loading @@ -221,13 +221,9 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr * @return true if the event is over the hotseat * @return true if the event is over the hotseat */ */ static boolean isTouchOverHotseat(Launcher launcher, MotionEvent ev) { static boolean isTouchOverHotseat(Launcher launcher, MotionEvent ev) { return (ev.getY() >= getHotseatTop(launcher)); } public static int getHotseatTop(Launcher launcher) { DeviceProfile dp = launcher.getDeviceProfile(); DeviceProfile dp = launcher.getDeviceProfile(); int hotseatHeight = dp.hotseatBarSizePx + dp.getInsets().bottom; int hotseatHeight = dp.hotseatBarSizePx + dp.getInsets().bottom; return launcher.getDragLayer().getHeight() - hotseatHeight; return (ev.getY() >= (launcher.getDragLayer().getHeight() - hotseatHeight)); } } @Override @Override Loading quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +0 −16 Original line number Original line Diff line number Diff line Loading @@ -7,11 +7,9 @@ import android.os.Bundle; import androidx.annotation.Nullable; import androidx.annotation.Nullable; import com.android.launcher3.LauncherState; import com.android.launcher3.testing.TestInformationHandler; import com.android.launcher3.testing.TestInformationHandler; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.util.LayoutUtils; public class QuickstepTestInformationHandler extends TestInformationHandler { public class QuickstepTestInformationHandler extends TestInformationHandler { Loading @@ -26,15 +24,6 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { public Bundle call(String method, String arg, @Nullable Bundle extras) { public Bundle call(String method, String arg, @Nullable Bundle extras) { final Bundle response = new Bundle(); final Bundle response = new Bundle(); switch (method) { switch (method) { case TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT: { return getLauncherUIProperty(Bundle::putInt, l -> { final float progress = LauncherState.OVERVIEW.getVerticalProgress(l) - LauncherState.ALL_APPS.getVerticalProgress(l); final float distance = l.getAllAppsController().getShiftRange() * progress; return (int) distance; }); } case TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT: { case TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT: { final float swipeHeight = final float swipeHeight = LayoutUtils.getDefaultSwipeHeight(mContext, mDeviceProfile); LayoutUtils.getDefaultSwipeHeight(mContext, mDeviceProfile); Loading @@ -50,11 +39,6 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { return response; return response; } } case TestProtocol.REQUEST_HOTSEAT_TOP: { return getLauncherUIProperty( Bundle::putInt, PortraitStatesTouchController::getHotseatTop); } case TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET: { case TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET: { if (!mDeviceProfile.isTablet) { if (!mDeviceProfile.isTablet) { return null; return null; Loading quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -165,7 +165,7 @@ public class FallbackRecentsTest { assertTrue("Fallback Launcher not visible", mDevice.wait(Until.hasObject(By.pkg( assertTrue("Fallback Launcher not visible", mDevice.wait(Until.hasObject(By.pkg( mOtherLauncherActivity.packageName)), WAIT_TIME_MS)); mOtherLauncherActivity.packageName)), WAIT_TIME_MS)); mLauncher.getBackground().switchToOverview(); mLauncher.getLaunchedAppState().switchToOverview(); } } // b/143488140 // b/143488140 Loading @@ -174,7 +174,7 @@ public class FallbackRecentsTest { public void goToOverviewFromApp() { public void goToOverviewFromApp() { startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); mLauncher.getBackground().switchToOverview(); mLauncher.getLaunchedAppState().switchToOverview(); } } protected void executeOnRecents(Consumer<RecentsActivity> f) { protected void executeOnRecents(Consumer<RecentsActivity> f) { Loading @@ -200,7 +200,7 @@ public class FallbackRecentsTest { private BaseOverview pressHomeAndGoToOverview() { private BaseOverview pressHomeAndGoToOverview() { mDevice.pressHome(); mDevice.pressHome(); return mLauncher.getBackground().switchToOverview(); return mLauncher.getLaunchedAppState().switchToOverview(); } } // b/143488140 // b/143488140 Loading @@ -213,7 +213,7 @@ public class FallbackRecentsTest { Wait.atMost("Expected three apps in the task list", Wait.atMost("Expected three apps in the task list", () -> mLauncher.getRecentTasks().size() >= 3, DEFAULT_ACTIVITY_TIMEOUT, mLauncher); () -> mLauncher.getRecentTasks().size() >= 3, DEFAULT_ACTIVITY_TIMEOUT, mLauncher); BaseOverview overview = mLauncher.getBackground().switchToOverview(); BaseOverview overview = mLauncher.getLaunchedAppState().switchToOverview(); executeOnRecents(recents -> { executeOnRecents(recents -> { assertTrue("Don't have at least 3 tasks", getTaskCount(recents) >= 3); assertTrue("Don't have at least 3 tasks", getTaskCount(recents) >= 3); }); }); Loading quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -78,7 +78,7 @@ public class StartLauncherViaGestureTests extends AbstractQuickStepTest { closeLauncherActivity(); closeLauncherActivity(); // The test action. // The test action. mLauncher.getBackground().switchToOverview(); mLauncher.getLaunchedAppState().switchToOverview(); } } closeLauncherActivity(); closeLauncherActivity(); mLauncher.pressHome(); mLauncher.pressHome(); Loading quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +22 −21 Original line number Original line Diff line number Diff line Loading @@ -32,8 +32,8 @@ import androidx.test.uiautomator.Until; import com.android.launcher3.Launcher; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherState; import com.android.launcher3.tapl.AllApps; import com.android.launcher3.tapl.HomeAllApps; import com.android.launcher3.tapl.Background; import com.android.launcher3.tapl.LaunchedAppState; import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel; import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.OverviewActions; import com.android.launcher3.tapl.OverviewActions; Loading Loading @@ -84,7 +84,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { executeOnLauncher(launcher -> assertTrue( executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the top " "Launcher activity is the top activity; expecting another activity to be the top " + "one", + "one", isInBackground(launcher))); isInLaunchedApp(launcher))); } } @Test @Test Loading Loading @@ -136,7 +136,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { executeOnLauncher(launcher -> assertTrue( executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the top " "Launcher activity is the top activity; expecting another activity to be the top " + "one", + "one", isInBackground(launcher))); isInLaunchedApp(launcher))); // Test dismissing a task. // Test dismissing a task. overview = mLauncher.pressHome().switchToOverview(); overview = mLauncher.pressHome().switchToOverview(); Loading Loading @@ -210,21 +210,22 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @PortraitLandscape @PortraitLandscape public void testBackground() throws Exception { public void testBackground() throws Exception { startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); final Background background = getAndAssertBackground(); final LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); assertNotNull("Background.switchToOverview() returned null", background.switchToOverview()); assertNotNull("Background.switchToOverview() returned null", launchedAppState.switchToOverview()); assertTrue("Launcher internal state didn't switch to Overview", assertTrue("Launcher internal state didn't switch to Overview", isInState(() -> LauncherState.OVERVIEW)); isInState(() -> LauncherState.OVERVIEW)); } } private Background getAndAssertBackground() { private LaunchedAppState getAndAssertLaunchedApp() { final Background background = mLauncher.getBackground(); final LaunchedAppState launchedAppState = mLauncher.getLaunchedAppState(); assertNotNull("Launcher.getBackground() returned null", background); assertNotNull("Launcher.getLaunchedApp() returned null", launchedAppState); executeOnLauncher(launcher -> assertTrue( executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the top " "Launcher activity is the top activity; expecting another activity to be the top " + "one", + "one", isInBackground(launcher))); isInLaunchedApp(launcher))); return background; return launchedAppState; } } @Test @Test Loading Loading @@ -253,13 +254,13 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { startTestActivity(3); startTestActivity(3); startTestActivity(4); startTestActivity(4); Background background = getAndAssertBackground(); LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); background.quickSwitchToPreviousApp(); launchedAppState.quickSwitchToPreviousApp(); assertTrue("The first app we should have quick switched to is not running", assertTrue("The first app we should have quick switched to is not running", isTestActivityRunning(3)); isTestActivityRunning(3)); background = getAndAssertBackground(); launchedAppState = getAndAssertLaunchedApp(); background.quickSwitchToPreviousApp(); launchedAppState.quickSwitchToPreviousApp(); if (mLauncher.getNavigationModel() == NavigationModel.THREE_BUTTON) { if (mLauncher.getNavigationModel() == NavigationModel.THREE_BUTTON) { // 3-button mode toggles between 2 apps, rather than going back further. // 3-button mode toggles between 2 apps, rather than going back further. assertTrue("Second quick switch should have returned to the first app.", assertTrue("Second quick switch should have returned to the first app.", Loading @@ -268,13 +269,13 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTrue("The second app we should have quick switched to is not running", assertTrue("The second app we should have quick switched to is not running", isTestActivityRunning(2)); isTestActivityRunning(2)); } } background = getAndAssertBackground(); launchedAppState = getAndAssertLaunchedApp(); background.quickSwitchToPreviousAppSwipeLeft(); launchedAppState.quickSwitchToPreviousAppSwipeLeft(); assertTrue("The 2nd app we should have quick switched to is not running", assertTrue("The 2nd app we should have quick switched to is not running", isTestActivityRunning(3)); isTestActivityRunning(3)); background = getAndAssertBackground(); launchedAppState = getAndAssertLaunchedApp(); background.switchToOverview(); launchedAppState.switchToOverview(); } } private boolean isTestActivityRunning(int activityNumber) { private boolean isTestActivityRunning(int activityNumber) { Loading @@ -291,7 +292,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { mLauncher.pressHome().quickSwitchToPreviousApp(); mLauncher.pressHome().quickSwitchToPreviousApp(); assertTrue("The most recent task is not running after quick switching from home", assertTrue("The most recent task is not running after quick switching from home", isTestActivityRunning(2)); isTestActivityRunning(2)); getAndAssertBackground(); getAndAssertLaunchedApp(); } } // TODO(b/204830798): test with all navigation modes(add @NavigationModeSwitch annotation) // TODO(b/204830798): test with all navigation modes(add @NavigationModeSwitch annotation) Loading @@ -306,7 +307,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { mLauncher.getWorkspace(); mLauncher.getWorkspace(); waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL); waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL); AllApps allApps = mLauncher.getWorkspace().switchToAllApps(); HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps(); allApps.freeze(); allApps.freeze(); try { try { allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false); allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false); Loading Loading
quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +1 −5 Original line number Original line Diff line number Diff line Loading @@ -221,13 +221,9 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr * @return true if the event is over the hotseat * @return true if the event is over the hotseat */ */ static boolean isTouchOverHotseat(Launcher launcher, MotionEvent ev) { static boolean isTouchOverHotseat(Launcher launcher, MotionEvent ev) { return (ev.getY() >= getHotseatTop(launcher)); } public static int getHotseatTop(Launcher launcher) { DeviceProfile dp = launcher.getDeviceProfile(); DeviceProfile dp = launcher.getDeviceProfile(); int hotseatHeight = dp.hotseatBarSizePx + dp.getInsets().bottom; int hotseatHeight = dp.hotseatBarSizePx + dp.getInsets().bottom; return launcher.getDragLayer().getHeight() - hotseatHeight; return (ev.getY() >= (launcher.getDragLayer().getHeight() - hotseatHeight)); } } @Override @Override Loading
quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +0 −16 Original line number Original line Diff line number Diff line Loading @@ -7,11 +7,9 @@ import android.os.Bundle; import androidx.annotation.Nullable; import androidx.annotation.Nullable; import com.android.launcher3.LauncherState; import com.android.launcher3.testing.TestInformationHandler; import com.android.launcher3.testing.TestInformationHandler; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.util.LayoutUtils; public class QuickstepTestInformationHandler extends TestInformationHandler { public class QuickstepTestInformationHandler extends TestInformationHandler { Loading @@ -26,15 +24,6 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { public Bundle call(String method, String arg, @Nullable Bundle extras) { public Bundle call(String method, String arg, @Nullable Bundle extras) { final Bundle response = new Bundle(); final Bundle response = new Bundle(); switch (method) { switch (method) { case TestProtocol.REQUEST_ALL_APPS_TO_OVERVIEW_SWIPE_HEIGHT: { return getLauncherUIProperty(Bundle::putInt, l -> { final float progress = LauncherState.OVERVIEW.getVerticalProgress(l) - LauncherState.ALL_APPS.getVerticalProgress(l); final float distance = l.getAllAppsController().getShiftRange() * progress; return (int) distance; }); } case TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT: { case TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT: { final float swipeHeight = final float swipeHeight = LayoutUtils.getDefaultSwipeHeight(mContext, mDeviceProfile); LayoutUtils.getDefaultSwipeHeight(mContext, mDeviceProfile); Loading @@ -50,11 +39,6 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { return response; return response; } } case TestProtocol.REQUEST_HOTSEAT_TOP: { return getLauncherUIProperty( Bundle::putInt, PortraitStatesTouchController::getHotseatTop); } case TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET: { case TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET: { if (!mDeviceProfile.isTablet) { if (!mDeviceProfile.isTablet) { return null; return null; Loading
quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -165,7 +165,7 @@ public class FallbackRecentsTest { assertTrue("Fallback Launcher not visible", mDevice.wait(Until.hasObject(By.pkg( assertTrue("Fallback Launcher not visible", mDevice.wait(Until.hasObject(By.pkg( mOtherLauncherActivity.packageName)), WAIT_TIME_MS)); mOtherLauncherActivity.packageName)), WAIT_TIME_MS)); mLauncher.getBackground().switchToOverview(); mLauncher.getLaunchedAppState().switchToOverview(); } } // b/143488140 // b/143488140 Loading @@ -174,7 +174,7 @@ public class FallbackRecentsTest { public void goToOverviewFromApp() { public void goToOverviewFromApp() { startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); mLauncher.getBackground().switchToOverview(); mLauncher.getLaunchedAppState().switchToOverview(); } } protected void executeOnRecents(Consumer<RecentsActivity> f) { protected void executeOnRecents(Consumer<RecentsActivity> f) { Loading @@ -200,7 +200,7 @@ public class FallbackRecentsTest { private BaseOverview pressHomeAndGoToOverview() { private BaseOverview pressHomeAndGoToOverview() { mDevice.pressHome(); mDevice.pressHome(); return mLauncher.getBackground().switchToOverview(); return mLauncher.getLaunchedAppState().switchToOverview(); } } // b/143488140 // b/143488140 Loading @@ -213,7 +213,7 @@ public class FallbackRecentsTest { Wait.atMost("Expected three apps in the task list", Wait.atMost("Expected three apps in the task list", () -> mLauncher.getRecentTasks().size() >= 3, DEFAULT_ACTIVITY_TIMEOUT, mLauncher); () -> mLauncher.getRecentTasks().size() >= 3, DEFAULT_ACTIVITY_TIMEOUT, mLauncher); BaseOverview overview = mLauncher.getBackground().switchToOverview(); BaseOverview overview = mLauncher.getLaunchedAppState().switchToOverview(); executeOnRecents(recents -> { executeOnRecents(recents -> { assertTrue("Don't have at least 3 tasks", getTaskCount(recents) >= 3); assertTrue("Don't have at least 3 tasks", getTaskCount(recents) >= 3); }); }); Loading
quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -78,7 +78,7 @@ public class StartLauncherViaGestureTests extends AbstractQuickStepTest { closeLauncherActivity(); closeLauncherActivity(); // The test action. // The test action. mLauncher.getBackground().switchToOverview(); mLauncher.getLaunchedAppState().switchToOverview(); } } closeLauncherActivity(); closeLauncherActivity(); mLauncher.pressHome(); mLauncher.pressHome(); Loading
quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +22 −21 Original line number Original line Diff line number Diff line Loading @@ -32,8 +32,8 @@ import androidx.test.uiautomator.Until; import com.android.launcher3.Launcher; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherState; import com.android.launcher3.tapl.AllApps; import com.android.launcher3.tapl.HomeAllApps; import com.android.launcher3.tapl.Background; import com.android.launcher3.tapl.LaunchedAppState; import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel; import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.OverviewActions; import com.android.launcher3.tapl.OverviewActions; Loading Loading @@ -84,7 +84,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { executeOnLauncher(launcher -> assertTrue( executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the top " "Launcher activity is the top activity; expecting another activity to be the top " + "one", + "one", isInBackground(launcher))); isInLaunchedApp(launcher))); } } @Test @Test Loading Loading @@ -136,7 +136,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { executeOnLauncher(launcher -> assertTrue( executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the top " "Launcher activity is the top activity; expecting another activity to be the top " + "one", + "one", isInBackground(launcher))); isInLaunchedApp(launcher))); // Test dismissing a task. // Test dismissing a task. overview = mLauncher.pressHome().switchToOverview(); overview = mLauncher.pressHome().switchToOverview(); Loading Loading @@ -210,21 +210,22 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @PortraitLandscape @PortraitLandscape public void testBackground() throws Exception { public void testBackground() throws Exception { startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); final Background background = getAndAssertBackground(); final LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); assertNotNull("Background.switchToOverview() returned null", background.switchToOverview()); assertNotNull("Background.switchToOverview() returned null", launchedAppState.switchToOverview()); assertTrue("Launcher internal state didn't switch to Overview", assertTrue("Launcher internal state didn't switch to Overview", isInState(() -> LauncherState.OVERVIEW)); isInState(() -> LauncherState.OVERVIEW)); } } private Background getAndAssertBackground() { private LaunchedAppState getAndAssertLaunchedApp() { final Background background = mLauncher.getBackground(); final LaunchedAppState launchedAppState = mLauncher.getLaunchedAppState(); assertNotNull("Launcher.getBackground() returned null", background); assertNotNull("Launcher.getLaunchedApp() returned null", launchedAppState); executeOnLauncher(launcher -> assertTrue( executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the top " "Launcher activity is the top activity; expecting another activity to be the top " + "one", + "one", isInBackground(launcher))); isInLaunchedApp(launcher))); return background; return launchedAppState; } } @Test @Test Loading Loading @@ -253,13 +254,13 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { startTestActivity(3); startTestActivity(3); startTestActivity(4); startTestActivity(4); Background background = getAndAssertBackground(); LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); background.quickSwitchToPreviousApp(); launchedAppState.quickSwitchToPreviousApp(); assertTrue("The first app we should have quick switched to is not running", assertTrue("The first app we should have quick switched to is not running", isTestActivityRunning(3)); isTestActivityRunning(3)); background = getAndAssertBackground(); launchedAppState = getAndAssertLaunchedApp(); background.quickSwitchToPreviousApp(); launchedAppState.quickSwitchToPreviousApp(); if (mLauncher.getNavigationModel() == NavigationModel.THREE_BUTTON) { if (mLauncher.getNavigationModel() == NavigationModel.THREE_BUTTON) { // 3-button mode toggles between 2 apps, rather than going back further. // 3-button mode toggles between 2 apps, rather than going back further. assertTrue("Second quick switch should have returned to the first app.", assertTrue("Second quick switch should have returned to the first app.", Loading @@ -268,13 +269,13 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTrue("The second app we should have quick switched to is not running", assertTrue("The second app we should have quick switched to is not running", isTestActivityRunning(2)); isTestActivityRunning(2)); } } background = getAndAssertBackground(); launchedAppState = getAndAssertLaunchedApp(); background.quickSwitchToPreviousAppSwipeLeft(); launchedAppState.quickSwitchToPreviousAppSwipeLeft(); assertTrue("The 2nd app we should have quick switched to is not running", assertTrue("The 2nd app we should have quick switched to is not running", isTestActivityRunning(3)); isTestActivityRunning(3)); background = getAndAssertBackground(); launchedAppState = getAndAssertLaunchedApp(); background.switchToOverview(); launchedAppState.switchToOverview(); } } private boolean isTestActivityRunning(int activityNumber) { private boolean isTestActivityRunning(int activityNumber) { Loading @@ -291,7 +292,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { mLauncher.pressHome().quickSwitchToPreviousApp(); mLauncher.pressHome().quickSwitchToPreviousApp(); assertTrue("The most recent task is not running after quick switching from home", assertTrue("The most recent task is not running after quick switching from home", isTestActivityRunning(2)); isTestActivityRunning(2)); getAndAssertBackground(); getAndAssertLaunchedApp(); } } // TODO(b/204830798): test with all navigation modes(add @NavigationModeSwitch annotation) // TODO(b/204830798): test with all navigation modes(add @NavigationModeSwitch annotation) Loading @@ -306,7 +307,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { mLauncher.getWorkspace(); mLauncher.getWorkspace(); waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL); waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL); AllApps allApps = mLauncher.getWorkspace().switchToAllApps(); HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps(); allApps.freeze(); allApps.freeze(); try { try { allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false); allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false); Loading