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

Commit 70232486 authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Waiting for Normal state after pressing meta key in AllApps

Bug: 313926097
Flag: N/A
Test: presubmit
Change-Id: I005183095833d7b0b8f9fa444af98932d3414ee4
parent 225bf586
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -363,6 +363,7 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer

    /**
     * Taps outside bottom sheet to dismiss it. Available on tablets only.
     *
     * @param tapRight Tap on the right of bottom sheet if true, or left otherwise.
     */
    public void dismissByTappingOutsideForTablet(boolean tapRight) {
@@ -391,7 +392,7 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer
    /** Presses the meta keyboard shortcut to dismiss AllApps. */
    public void dismissByKeyboardShortcut() {
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
            mLauncher.getDevice().pressKeyCode(KEYCODE_META_RIGHT);
            pressMetaKey();
            try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                    "pressed meta key")) {
                verifyVisibleContainerOnDismiss();
@@ -399,6 +400,10 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer
        }
    }

    protected void pressMetaKey() {
        mLauncher.getDevice().pressKeyCode(KEYCODE_META_RIGHT);
    }

    /** Presses the esc key to dismiss AllApps. */
    public void dismissByEscKey() {
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
@@ -419,6 +424,7 @@ public abstract class AllApps extends LauncherInstrumentation.VisibleContainer

    /**
     * Return the QSB UI object on the AllApps screen.
     *
     * @return the QSB UI object.
     */
    @NonNull
+9 −1
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@ public class HomeAllApps extends AllApps {

    /**
     * Swipes up or down to dismiss to Workspace.
     * @param swipeDown Swipe all apps down to dismiss, otherwise swipe up to dismiss by going home.
     *
     * @param swipeDown Swipe all apps down to dismiss, otherwise swipe up to dismiss by going home.
     * @return the Workspace object.
     */
    @NonNull
@@ -139,4 +139,12 @@ public class HomeAllApps extends AllApps {
                NORMAL_STATE_ORDINAL,
                "touching outside");
    }

    @Override
    protected void pressMetaKey() {
        mLauncher.runToState(
                () -> super.pressMetaKey(),
                NORMAL_STATE_ORDINAL,
                "pressing meta key");
    }
}