Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c1df6db authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Inserting waiting for settling in the Workspace state after "back" from All Apps

Bug: 313926097
Flag: N/A
Test: presubmit
Change-Id: Idd6e3383be21c2040797148817b96105a6f94fe3
parent 1c7bc492
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -208,9 +208,10 @@ public class TaplOpenCloseAllApps extends AbstractLauncherUiTest {
        InstrumentationRegistry.getInstrumentation().getUiAutomation().adoptShellPermissionIdentity(
                READ_DEVICE_CONFIG_PERMISSION);
        assumeFalse(FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get());
        mLauncher.getWorkspace().switchToAllApps();
        mLauncher.pressBack();
        mLauncher.getWorkspace();
        mLauncher
                .getWorkspace()
                .switchToAllApps()
                .pressBackToWorkspace();
        waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
        startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
        mLauncher.pressBack();
+13 −0
Original line number Diff line number Diff line
@@ -118,4 +118,17 @@ public class HomeAllApps extends AllApps {
    public boolean isHomeState() {
        return true;
    }

    /** Send the "back" gesture to go to workspace. */
    public Workspace pressBackToWorkspace() {
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
             LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                     "want to press back from all apps to workspace")) {
            mLauncher.runToState(
                    () -> mLauncher.pressBackImpl(),
                    NORMAL_STATE_ORDINAL,
                    "pressing back");
            return new Workspace(mLauncher);
        }
    }
}