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

Commit 3b5793fd authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Support for running Overview tests with quickstep on and off

Bug: 110103162
Test: TaplTests suite
Change-Id: Ic479156f2973aeec5cc3d288e1c891b8086d9daa
parent d6ba5041
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -185,14 +185,18 @@ public class OverviewInteractionState {
        return mSwipeGestureInitializing;
    }

    public void notifySwipeUpSettingChanged(boolean swipeUpEnabled) {
        mUiHandler.removeMessages(MSG_SET_SWIPE_UP_ENABLED);
        mUiHandler.obtainMessage(MSG_SET_SWIPE_UP_ENABLED, swipeUpEnabled ? 1 : 0, 0).
                sendToTarget();
    }

    private class SwipeUpGestureEnabledSettingObserver extends ContentObserver {
        private Handler mHandler;
        private ContentResolver mResolver;
        private final int defaultValue;

        SwipeUpGestureEnabledSettingObserver(Handler handler, ContentResolver resolver) {
            super(handler);
            mHandler = handler;
            mResolver = resolver;
            defaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue() ? 1 : 0;
        }
@@ -207,8 +211,7 @@ public class OverviewInteractionState {
        @Override
        public void onChange(boolean selfChange) {
            super.onChange(selfChange);
            mHandler.removeMessages(MSG_SET_SWIPE_UP_ENABLED);
            mHandler.obtainMessage(MSG_SET_SWIPE_UP_ENABLED, getValue() ? 1 : 0, 0).sendToTarget();
            notifySwipeUpSettingChanged(getValue());
        }

        private boolean getValue() {
+7 −1
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ public final class LauncherInstrumentation {

    private final UiDevice mDevice;
    private final boolean mSwipeUpEnabled;
    private Boolean mSwipeUpEnabledOverride = null;

    /**
     * Constructs the root of TAPL hierarchy. You get all other objects from it.
@@ -103,12 +104,17 @@ public final class LauncherInstrumentation {
        assertTrue("Device must run in a test harness", ActivityManager.isRunningInTestHarness());
    }

    // Used only by tests.
    public void overrideSwipeUpEnabled(Boolean swipeUpEnabledOverride) {
        mSwipeUpEnabledOverride = swipeUpEnabledOverride;
    }

    void setActiveContainer(VisibleContainer container) {
        sActiveContainer = new WeakReference<>(container);
    }

    boolean isSwipeUpEnabled() {
        return mSwipeUpEnabled;
        return mSwipeUpEnabledOverride != null ? mSwipeUpEnabledOverride : mSwipeUpEnabled;
    }

    private UiObject2 verifyContainerType(ContainerType containerType) {