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

Unverified Commit e183f40f authored by Michael Bestas's avatar Michael Bestas
Browse files

Revert "Trebuchet: Let's keep 2-button nav alive for a little longer"

This reverts commit cff78378.

Change-Id: Ia521e107783dfceaf2869cc0802f700c172b12e4
parent 71785051
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
@@ -315,7 +315,6 @@ public abstract class AbsSwipeUpHandler<

    private boolean mWasLauncherAlreadyVisible;

    private boolean mPassedOverviewThreshold;
    private boolean mGestureStarted;
    private boolean mLogDirectionUpOrLeft = true;
    private boolean mIsLikelyToStartNewTask;
@@ -877,14 +876,6 @@ public abstract class AbsSwipeUpHandler<
    @UiThread
    @Override
    public void onCurrentShiftUpdated() {
        final boolean passed = hasReachedHomeOverviewThreshold();
        if (passed != mPassedOverviewThreshold) {
            mPassedOverviewThreshold = passed;
            if (mDeviceState.isTwoButtonNavMode() && !mGestureState.isHandlingAtomicEvent()) {
                performHapticFeedback();
            }
        }

        updateSysUiFlags(mCurrentShift.value);
        applyScrollAndTransform();

@@ -983,8 +974,6 @@ public abstract class AbsSwipeUpHandler<
        mStateCallback.runOnceAtState(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED,
                this::startInterceptingTouchesForGesture);
        mStateCallback.setStateOnUiThread(STATE_APP_CONTROLLER_RECEIVED);

        mPassedOverviewThreshold = false;
    }

    @Override
@@ -1292,19 +1281,11 @@ public abstract class AbsSwipeUpHandler<
            return willGoToNewTask || isCenteredOnNewTask ? NEW_TASK : LAST_TASK;
        }

        if (!mDeviceState.isFullyGesturalNavMode()) {
            return (!hasReachedHomeOverviewThreshold() && willGoToNewTask) ? NEW_TASK : RECENTS;
        }
        return willGoToNewTask ? NEW_TASK : HOME;
    }

    private GestureEndTarget calculateEndTargetForNonFling(PointF velocity) {
        final boolean isScrollingToNewTask = isScrollingToNewTask();
        if (!mDeviceState.isFullyGesturalNavMode()) {
            return hasReachedHomeOverviewThreshold() && mGestureStarted
                    ? RECENTS
                    : (isScrollingToNewTask ? NEW_TASK : LAST_TASK);
        }

        // Fully gestural mode.
        final boolean isFlingX = Math.abs(velocity.x) > mContext.getResources()
@@ -1346,16 +1327,6 @@ public abstract class AbsSwipeUpHandler<
        mCanSlowSwipeGoHome = canSlowSwipeGoHome;
    }

    /**
     * Returns true if swipe has reached the overview threshold.
     */
    private boolean hasReachedHomeOverviewThreshold() {
        if (mIsTransientTaskbar) {
            return mCanSlowSwipeGoHome;
        }
        return mCurrentShift.value > MIN_PROGRESS_FOR_OVERVIEW;
    }

    @UiThread
    private void handleNormalGestureEnd(
            float endVelocityPxPerMs, boolean isFling, PointF velocityPxPerMs, boolean isCancel) {
+0 −8
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MOD
import static com.android.launcher3.util.DisplayController.CHANGE_ROTATION;
import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
import static com.android.launcher3.util.NavigationMode.TWO_BUTTONS;
import static com.android.launcher3.util.SettingsCache.ONE_HANDED_ENABLED;
import static com.android.launcher3.util.SettingsCache.ONE_HANDED_SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_CLICKABLE;
@@ -322,13 +321,6 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener, E
        return mMode.hasGestures;
    }

    /**
     * @return whether the current nav mode is 2-button-based.
     */
    public boolean isTwoButtonNavMode() {
        return mMode == TWO_BUTTONS;
    }

    /**
     * @return whether the current nav mode is button-based.
     */
+0 −20
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@ import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.graphics.PointF;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
@@ -62,7 +60,6 @@ import com.android.quickstep.TaskAnimationManager;
import com.android.quickstep.util.CachedEventDispatcher;
import com.android.quickstep.util.MotionPauseDetector;
import com.android.quickstep.util.NavBarPosition;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.InputChannelCompat.InputEventReceiver;
import com.android.systemui.shared.system.InputMonitorCompat;

@@ -127,12 +124,6 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
    // The callback called upon finishing the recents transition if it was force-canceled
    private Runnable mForceFinishRecentsTransitionCallback;

    private Handler mMainThreadHandler;
    private Runnable mCancelRecentsAnimationRunnable = () -> {
        ActivityManagerWrapper.getInstance().cancelRecentsAnimation(
                true /* restoreHomeStackPosition */);
    };

    public OtherActivityInputConsumer(Context base, RecentsAnimationDeviceState deviceState,
            TaskAnimationManager taskAnimationManager, GestureState gestureState,
            boolean isDeferredDownTarget, Consumer<OtherActivityInputConsumer> onCompleteCallback,
@@ -143,7 +134,6 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
        mNavBarPosition = mDeviceState.getNavBarPosition();
        mTaskAnimationManager = taskAnimationManager;
        mGestureState = gestureState;
        mMainThreadHandler = new Handler(Looper.getMainLooper());
        mHandlerFactory = handlerFactory;

        mMotionPauseDetector = new MotionPauseDetector(base, false,
@@ -504,15 +494,6 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
            }
            onConsumerAboutToBeSwitched();
            onInteractionGestureFinished();

            // Cancel the recents animation if SysUI happens to handle UP before we have a chance
            // to start the recents animation. In addition, workaround for b/126336729 by delaying
            // the cancel of the animation for a period, in case SysUI is slow to handle UP and we
            // handle DOWN & UP and move the home stack before SysUI can start the activity
            mMainThreadHandler.removeCallbacks(mCancelRecentsAnimationRunnable);
            if (!mDeviceState.isFullyGesturalNavMode()) {
                mMainThreadHandler.postDelayed(mCancelRecentsAnimationRunnable, 100);
            }
        }
        cleanupAfterGesture();
        TraceHelper.INSTANCE.endSection();
@@ -534,7 +515,6 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
    @Override
    public void onConsumerAboutToBeSwitched() {
        Preconditions.assertUIThread();
        mMainThreadHandler.removeCallbacks(mCancelRecentsAnimationRunnable);
        if (mInteractionHandler != null) {
            // The consumer is being switched while we are active. Set up the shared state to be
            // used by the next animation