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

Commit 6faf8468 authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas
Browse files

Disable quickswitch interactions with desktop mode

Disable quickswitch gestures when in desktop mode enviroment as well as
questures outside desktop mode that will result in the user entering
desktop mode.

Flag: NONE
Test: atest ShowImeOnAppStartWhenLaunchingAppFromQuickSwitchTest
      atest QuickSwitchBetweenTwoAppsForwardTest
      atest QuickSwitchBetweenTwoAppsBackTest
      atest QuickSwitchFromLauncherTest
      atest QuickswitchTest
      atest -c NexusLauncherTests:com.android.quickstep.TaplTestsQuickstep
      atest -c NexusLauncherTests:com.android.quickstep.TaplTestsTaskbar
      atest -c NexusLauncherTests:com.android.quickstep.TaplTestsTrackpad
      atest -c NexusLauncherTests:com.android.quickstep.TaplTestsTransientTaskbar
Fixes: 330148342
Change-Id: If11901e6642036f8b8dda38b3419f6c10980d902
parent cfc013fd
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_UP;
import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import static com.android.quickstep.views.DesktopTaskView.isDesktopModeSupported;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA;
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
@@ -178,10 +177,6 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
        if ((stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0) {
            return false;
        }
        if (isDesktopModeSupported()) {
            // TODO(b/268075592): add support for quickswitch to/from desktop
            return false;
        }
        if (isTrackpadMultiFingerSwipe(ev)) {
            return isTrackpadFourFingerSwipe(ev);
        }
+0 −5
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_VERTICAL_PR
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
import static com.android.quickstep.views.DesktopTaskView.isDesktopModeSupported;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD;
@@ -79,10 +78,6 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll
        if ((ev.getEdgeFlags() & Utilities.EDGE_NAV_BAR) == 0) {
            return false;
        }
        if (isDesktopModeSupported()) {
            // TODO(b/268075592): add support for quickswitch to/from desktop
            return false;
        }
        return true;
    }

+17 −2
Original line number Diff line number Diff line
@@ -1255,7 +1255,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            return LAST_TASK;
        }

        if (isDesktopModeSupported() && endTarget == NEW_TASK) {
        if (((mRecentsView.getNextPageTaskView() != null
                && mRecentsView.getNextPageTaskView().isDesktopTask())
                || (mRecentsView.getCurrentPageTaskView() != null
                && mRecentsView.getCurrentPageTaskView().isDesktopTask()))
                && endTarget == NEW_TASK) {
            // TODO(b/268075592): add support for quickswitch to/from desktop
            return LAST_TASK;
        }
@@ -1416,9 +1420,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED);
            setClampScrollOffset(false);
        };
        if (mRecentsView != null) {
        if (mRecentsView != null && (mRecentsView.getCurrentPageTaskView() != null
                && !mRecentsView.getCurrentPageTaskView().isDesktopTask())) {
            ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
                    .SET_ON_PAGE_TRANSITION_END_CALLBACK);
            // TODO(b/268075592): add support for quickswitch to/from desktop
            mRecentsView.setOnPageTransitionEndCallback(onPageTransitionEnd);
        } else {
            onPageTransitionEnd.run();
@@ -2232,6 +2238,15 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                    mRecentsAnimationController, mRecentsAnimationTargets);
        });

        if ((mRecentsView.getNextPageTaskView() != null
                && mRecentsView.getNextPageTaskView().isDesktopTask())
                || (mRecentsView.getCurrentPageTaskView() != null
                && mRecentsView.getCurrentPageTaskView().isDesktopTask())) {
            // TODO(b/268075592): add support for quickswitch to/from desktop
            mRecentsViewScrollLinked = false;
            return;
        }

        // Disable scrolling in RecentsView for trackpad 3-finger swipe up gesture.
        if (!mGestureState.isThreeFingerTrackpadGesture()) {
            mRecentsViewScrollLinked = true;