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

Commit 82b2ef27 authored by Winson Chung's avatar Winson Chung
Browse files

Reduce animation time for some common TAPL actions (affects jank/perf tests)



- All apps swipe up 1s -> 200ms (doesn't matter if it's a fling)
- Scroll to last visible row 2.5s -> 1.25s (seems sufficient to not be a fling)
- Drag icon to workspace 2s -> 500ms (seems sufficient to not be a fling)
- This changes the total frames produced for the jank tests, but should not
  change the jank proportion or the individual frame drawing times

Bug: 141484300
Change-Id: I9f2e647ebc2c27c6269238daa4c3e6ad314c8161
Signed-off-by: default avatarWinson Chung <winsonc@google.com>
parent bd83aead
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
                        "Exceeded max scroll attempts: " + MAX_SCROLL_ATTEMPTS,
                        ++attempts <= MAX_SCROLL_ATTEMPTS);

                mLauncher.scroll(allAppsContainer, Direction.UP, margins, 50);
                mLauncher.scroll(allAppsContainer, Direction.UP, margins, 12);
            }

            try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("scrolled up")) {
+2 −6
Original line number Diff line number Diff line
@@ -424,11 +424,7 @@ public final class LauncherInstrumentation {
        // b/136278866
        for (int i = 0; i != 100; ++i) {
            if (getNavigationModeMismatchError() == null) break;
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            sleep(100);
        }

        final String error = getNavigationModeMismatchError();
@@ -803,7 +799,7 @@ public final class LauncherInstrumentation {
                        0,
                        0,
                        Math.max(bottomMargin, getBottomGestureMargin(container))),
                150);
                70);
    }

    void scroll(UiObject2 container, Direction direction, Rect margins, int steps) {
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public final class Overview extends BaseOverview {
                            getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD),
                    mLauncher.getDevice().getDisplayWidth() / 2,
                    0,
                    50,
                    12,
                    ALL_APPS_STATE_ORDINAL);

            try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
+3 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ import com.android.launcher3.testing.TestProtocol;
 * Operations on the workspace screen.
 */
public final class Workspace extends Home {
    private static final int DRAG_DURACTION = 2000;
    private static final int DRAG_DURATION = 500;
    private static final int FLING_STEPS = 10;
    private final UiObject2 mHotseat;

@@ -72,7 +72,7 @@ public final class Workspace extends Home {
                    start.y,
                    start.x,
                    start.y - swipeHeight - mLauncher.getTouchSlop(),
                    60,
                    12,
                    ALL_APPS_STATE_ORDINAL);

            try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
@@ -166,7 +166,7 @@ public final class Workspace extends Home {
        launcher.waitForLauncherObject(longPressIndicator);
        LauncherInstrumentation.log("dragIconToWorkspace: indicator");
        launcher.movePointer(
                downTime, SystemClock.uptimeMillis(), DRAG_DURACTION, launchableCenter, dest);
                downTime, SystemClock.uptimeMillis(), DRAG_DURATION, launchableCenter, dest);
        LauncherInstrumentation.log("dragIconToWorkspace: moved pointer");
        launcher.sendPointer(
                downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, dest);