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

Commit 76dd9d4e authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Inserting waiting for wallpaper animation into "back" gesture from app to workspace

Bug: 313926097
Flag: N/A
Test: presubmit
Change-Id: Ib0f6d62de5caba00823618bdf661d0e4f27e5650
parent a473968d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public class TaplTestsTrackpad extends AbstractQuickStepTest {
            mLauncher.setTrackpadGestureType(TrackpadGestureType.THREE_FINGER);

            startTestActivity(2);
            mLauncher.pressBack();
            mLauncher.getLaunchedAppState().pressBackToWorkspace();
        } finally {
            instrumentation.getUiAutomation().dropShellPermissionIdentity();
        }
+13 −0
Original line number Diff line number Diff line
@@ -340,4 +340,17 @@ public final class LaunchedAppState extends Background {
            }
        }
    }

    /** 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 launched app to workspace")) {
            mLauncher.executeAndWaitForWallpaperAnimation(
                    () -> mLauncher.pressBackImpl(),
                    "pressing back"
            );
            return new Workspace(mLauncher);
        }
    }
}
+27 −23
Original line number Diff line number Diff line
@@ -1112,6 +1112,11 @@ public final class LauncherInstrumentation {
     */
    public void pressBack() {
        try (Closable e = eventsCheck(); Closable c = addContextLayer("want to press back")) {
            pressBackImpl();
        }
    }

    void pressBackImpl() {
        waitForLauncherInitialized();
        final boolean launcherVisible =
                isTablet() ? isLauncherContainerVisible() : isLauncherVisible();
@@ -1138,7 +1143,6 @@ public final class LauncherInstrumentation {
            }
        }
    }
    }

    private static BySelector getAnyObjectSelector() {
        return By.textStartsWith("");