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

Commit fd309ca3 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

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

parents 553a2c87 9c1df6db
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);
        }
    }
}