diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 60ee38f..be1d0b6 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -1142,15 +1142,6 @@
     }
 
     /**
-     * Called when we detect a long press in the nav region before passing the gesture slop.
-     *
-     * @return Whether taskbar handled the long press, and thus should cancel the gesture.
-     */
-    public boolean onLongPressToUnstashTaskbar() {
-        return mControllers.taskbarStashController.onLongPressToUnstashTaskbar();
-    }
-
-    /**
      * Called when we want to unstash taskbar when user performs swipes up gesture.
      */
     public void onSwipeToUnstashTaskbar() {
@@ -1205,28 +1196,7 @@
      * @param animateForward Whether to animate towards the unstashed hint state or back to stashed.
      */
     public void startTaskbarUnstashHint(boolean animateForward) {
-        // TODO(b/270395798): Clean up forceUnstash after removing long-press unstashing code.
-        startTaskbarUnstashHint(animateForward, /* forceUnstash = */ false);
-    }
-
-    /**
-     * Called when we detect a motion down or up/cancel in the nav region while stashed.
-     *
-     * @param animateForward Whether to animate towards the unstashed hint state or back to stashed.
-     * @param forceUnstash   Whether we force the unstash hint.
-     */
-    public void startTaskbarUnstashHint(boolean animateForward, boolean forceUnstash) {
-        // TODO(b/270395798): Clean up forceUnstash after removing long-press unstashing code.
-        mControllers.taskbarStashController.startUnstashHint(animateForward, forceUnstash);
-    }
-
-    /**
-     * Enables manual taskbar stashing. This method should only be used for tests that need to
-     * stash/unstash the taskbar.
-     */
-    @VisibleForTesting
-    public void enableManualStashingDuringTests(boolean enableManualStashing) {
-        mControllers.taskbarStashController.enableManualStashingDuringTests(enableManualStashing);
+        mControllers.taskbarStashController.startUnstashHint(animateForward);
     }
 
     /**
@@ -1239,15 +1209,12 @@
     }
 
     /**
-     * Unstashes the Taskbar if it is stashed. This method should only be used to unstash the
-     * taskbar at the end of a test.
+     * Unstashes the Taskbar if it is stashed.
      */
     @VisibleForTesting
     public void unstashTaskbarIfStashed() {
         if (DisplayController.isTransientTaskbar(this)) {
             mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false);
-        } else {
-            mControllers.taskbarStashController.onLongPressToUnstashTaskbar();
         }
     }
 
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
index ffaee45..294925f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarForceVisibleImmersiveController.java
@@ -158,8 +158,7 @@
 
     @Override
     public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
-        if (!isNavbarShownInImmersiveMode()
-                || mControllers.taskbarStashController.supportsManualStashing()) {
+        if (!isNavbarShownInImmersiveMode()) {
             return false;
         }
         return onControllerTouchEvent(ev);
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index a34df4f..9c532ec 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -15,17 +15,12 @@
  */
 package com.android.launcher3.taskbar;
 
-import static android.view.HapticFeedbackConstants.LONG_PRESS;
 import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_CONTROLS;
 
 import static com.android.app.animation.Interpolators.EMPHASIZED;
 import static com.android.app.animation.Interpolators.FINAL_FRAME;
 import static com.android.app.animation.Interpolators.INSTANT;
 import static com.android.app.animation.Interpolators.LINEAR;
-import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING;
-import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_HIDE;
-import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_SHOW;
 import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_HIDE;
 import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_SHOW;
 import static com.android.launcher3.taskbar.TaskbarKeyguardController.MASK_ANY_SYSUI_LOCKED;
@@ -44,7 +39,6 @@
 import android.animation.AnimatorListenerAdapter;
 import android.animation.AnimatorSet;
 import android.app.RemoteAction;
-import android.content.SharedPreferences;
 import android.graphics.drawable.Icon;
 import android.os.SystemClock;
 import android.util.Log;
@@ -62,9 +56,7 @@
 import com.android.internal.jank.InteractionJankMonitor;
 import com.android.launcher3.Alarm;
 import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.LauncherPrefs;
 import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
 import com.android.launcher3.anim.AnimatedFloat;
 import com.android.launcher3.anim.AnimatorListeners;
 import com.android.launcher3.util.DisplayController;
@@ -86,27 +78,26 @@
     private static final boolean DEBUG = false;
 
     public static final int FLAG_IN_APP = 1 << 0;
-    public static final int FLAG_STASHED_IN_APP_MANUAL = 1 << 1; // long press, persisted
-    public static final int FLAG_STASHED_IN_APP_SYSUI = 1 << 2; // shade open, ...
-    public static final int FLAG_STASHED_IN_APP_SETUP = 1 << 3; // setup wizard and AllSetActivity
-    public static final int FLAG_STASHED_IN_APP_IME = 1 << 4; // IME is visible
-    public static final int FLAG_IN_STASHED_LAUNCHER_STATE = 1 << 5;
-    public static final int FLAG_STASHED_IN_TASKBAR_ALL_APPS = 1 << 6; // All apps is visible.
-    public static final int FLAG_IN_SETUP = 1 << 7; // In the Setup Wizard
-    public static final int FLAG_STASHED_SMALL_SCREEN = 1 << 8; // phone screen gesture nav, stashed
-    public static final int FLAG_STASHED_IN_APP_AUTO = 1 << 9; // Autohide (transient taskbar).
-    public static final int FLAG_STASHED_SYSUI = 1 << 10; //  app pinning,...
-    public static final int FLAG_STASHED_DEVICE_LOCKED = 1 << 11; // device is locked: keyguard, ...
-    public static final int FLAG_IN_OVERVIEW = 1 << 12; // launcher is in overview
+    public static final int FLAG_STASHED_IN_APP_SYSUI = 1 << 1; // shade open, ...
+    public static final int FLAG_STASHED_IN_APP_SETUP = 1 << 2; // setup wizard and AllSetActivity
+    public static final int FLAG_STASHED_IN_APP_IME = 1 << 3; // IME is visible
+    public static final int FLAG_IN_STASHED_LAUNCHER_STATE = 1 << 4;
+    public static final int FLAG_STASHED_IN_TASKBAR_ALL_APPS = 1 << 5; // All apps is visible.
+    public static final int FLAG_IN_SETUP = 1 << 6; // In the Setup Wizard
+    public static final int FLAG_STASHED_SMALL_SCREEN = 1 << 7; // phone screen gesture nav, stashed
+    public static final int FLAG_STASHED_IN_APP_AUTO = 1 << 8; // Autohide (transient taskbar).
+    public static final int FLAG_STASHED_SYSUI = 1 << 9; //  app pinning,...
+    public static final int FLAG_STASHED_DEVICE_LOCKED = 1 << 10; // device is locked: keyguard, ...
+    public static final int FLAG_IN_OVERVIEW = 1 << 11; // launcher is in overview
 
     // If any of these flags are enabled, isInApp should return true.
     private static final int FLAGS_IN_APP = FLAG_IN_APP | FLAG_IN_SETUP;
 
     // If we're in an app and any of these flags are enabled, taskbar should be stashed.
-    private static final int FLAGS_STASHED_IN_APP = FLAG_STASHED_IN_APP_MANUAL
-            | FLAG_STASHED_IN_APP_SYSUI | FLAG_STASHED_IN_APP_SETUP
-            | FLAG_STASHED_IN_APP_IME | FLAG_STASHED_IN_TASKBAR_ALL_APPS
-            | FLAG_STASHED_SMALL_SCREEN | FLAG_STASHED_IN_APP_AUTO;
+    private static final int FLAGS_STASHED_IN_APP =  FLAG_STASHED_IN_APP_SYSUI
+            | FLAG_STASHED_IN_APP_SETUP | FLAG_STASHED_IN_APP_IME
+            | FLAG_STASHED_IN_TASKBAR_ALL_APPS | FLAG_STASHED_SMALL_SCREEN
+            | FLAG_STASHED_IN_APP_AUTO;
 
     // If any of these flags are enabled, inset apps by our stashed height instead of our unstashed
     // height. This way the reported insets are consistent even during transitions out of the app.
@@ -167,21 +158,11 @@
     private static final long TASKBAR_STASH_ICON_ALPHA_HOME_TO_APP_START_DELAY = 66;
 
     /**
-     * The scale that TaskbarView animates to when hinting towards the stashed state.
-     */
-    private static final float STASHED_TASKBAR_HINT_SCALE = 0.9f;
-
-    /**
      * The scale that the stashed handle animates to when hinting towards the unstashed state.
      */
     private static final float UNSTASHED_TASKBAR_HANDLE_HINT_SCALE = 1.1f;
 
     /**
-     * The SharedPreferences key for whether user has manually stashed the taskbar.
-     */
-    private static final String SHARED_PREFS_STASHED_KEY = "taskbar_is_stashed";
-
-    /**
      * Whether taskbar should be stashed out of the box.
      */
     private static final boolean DEFAULT_STASHED_PREF = false;
@@ -224,7 +205,6 @@
     private @interface StashAnimation {}
 
     private final TaskbarActivityContext mActivity;
-    private final SharedPreferences mPrefs;
     private final int mStashedHeight;
     private final int mUnstashedHeight;
     private final SystemUiProxy mSystemUiProxy;
@@ -253,8 +233,6 @@
     private boolean mIsImeShowing;
     private boolean mIsImeSwitcherShowing;
 
-    private boolean mEnableManualStashingDuringTests = false;
-
     private final Alarm mTimeoutAlarm = new Alarm();
     private boolean mEnableBlockingTimeoutDuringTests = false;
 
@@ -274,7 +252,6 @@
 
     public TaskbarStashController(TaskbarActivityContext activity) {
         mActivity = activity;
-        mPrefs = LauncherPrefs.getPrefs(mActivity);
         mSystemUiProxy = SystemUiProxy.INSTANCE.get(activity);
         mAccessibilityManager = mActivity.getSystemService(AccessibilityManager.class);
 
@@ -328,15 +305,7 @@
         mTaskbarStashedHandleHintScale = stashedHandleController.getStashedHandleHintScale();
 
         boolean isTransientTaskbar = DisplayController.isTransientTaskbar(mActivity);
-        // We use supportsVisualStashing() here instead of supportsManualStashing() because we want
-        // it to work properly for tests that recreate taskbar. This check is here just to ensure
-        // that taskbar unstashes when going to 3 button mode (supportsVisualStashing() false).
-        boolean isManuallyStashedInApp = supportsVisualStashing()
-                && !isTransientTaskbar
-                && !enableTaskbarPinning()
-                && mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF);
         boolean isInSetup = !mActivity.isUserSetupComplete() || setupUIVisible;
-        updateStateForFlag(FLAG_STASHED_IN_APP_MANUAL, isManuallyStashedInApp);
         updateStateForFlag(FLAG_STASHED_IN_APP_AUTO,
                 isTransientTaskbar && !mTaskbarSharedState.taskbarWasPinned);
         updateStateForFlag(FLAG_STASHED_IN_APP_SETUP, isInSetup);
@@ -362,28 +331,6 @@
     }
 
     /**
-     * Returns whether the user can manually stash the taskbar based on the current device state.
-     */
-    protected boolean supportsManualStashing() {
-        if (enableTaskbarPinning() && LauncherPrefs.get(mActivity).get(TASKBAR_PINNING)) {
-            return false;
-        }
-        return supportsVisualStashing()
-                && isInApp()
-                && (!Utilities.isRunningInTestHarness() || mEnableManualStashingDuringTests)
-                && !DisplayController.isTransientTaskbar(mActivity);
-    }
-
-    /**
-     * Enables support for manual stashing. This should only be used to add this functionality
-     * to Launcher specific tests.
-     */
-    @VisibleForTesting
-    public void enableManualStashingDuringTests(boolean enableManualStashing) {
-        mEnableManualStashingDuringTests = enableManualStashing;
-    }
-
-    /**
      * Enables the auto timeout for taskbar stashing. This method should only be used for taskbar
      * testing.
      */
@@ -577,53 +524,6 @@
                 /* shouldBubblesFollow= */ !bubbleBarExpanded);
     }
 
-    /**
-     * Should be called when long pressing the nav region when taskbar is present.
-     * @return Whether taskbar was stashed and now is unstashed.
-     */
-    public boolean onLongPressToUnstashTaskbar() {
-        if (!isStashed()) {
-            // We only listen for long press on the nav region to unstash the taskbar. To stash the
-            // taskbar, we use an OnLongClickListener on TaskbarView instead.
-            return false;
-        }
-        if (!canCurrentlyManuallyUnstash()) {
-            return false;
-        }
-        if (updateAndAnimateIsManuallyStashedInApp(false)) {
-            mControllers.taskbarActivityContext.getDragLayer().performHapticFeedback(LONG_PRESS);
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Returns whether taskbar will unstash when long pressing it based on the current state. The
-     * only time this is true is if the user is in an app and the taskbar is only stashed because
-     * the user previously long pressed to manually stash (not due to other reasons like IME).
-     */
-    private boolean canCurrentlyManuallyUnstash() {
-        return (mState & (FLAG_IN_APP | FLAGS_STASHED_IN_APP))
-                == (FLAG_IN_APP | FLAG_STASHED_IN_APP_MANUAL);
-    }
-
-    /**
-     * Updates whether we should stash the taskbar when in apps, and animates to the changed state.
-     * @return Whether we started an animation to either be newly stashed or unstashed.
-     */
-    public boolean updateAndAnimateIsManuallyStashedInApp(boolean isManuallyStashedInApp) {
-        if (!supportsManualStashing()) {
-            return false;
-        }
-        if (hasAnyFlag(FLAG_STASHED_IN_APP_MANUAL) != isManuallyStashedInApp) {
-            mPrefs.edit().putBoolean(SHARED_PREFS_STASHED_KEY, isManuallyStashedInApp).apply();
-            updateStateForFlag(FLAG_STASHED_IN_APP_MANUAL, isManuallyStashedInApp);
-            applyState();
-            return true;
-        }
-        return false;
-    }
-
     /** Toggles the Taskbar's stash state. */
     public void toggleTaskbarStash() {
         if (!DisplayController.isTransientTaskbar(mActivity) || !hasAnyFlag(FLAGS_IN_APP)) return;
@@ -910,21 +810,6 @@
             }
         });
     }
-    /**
-     * Creates and starts a partial stash animation, hinting at the new state that will trigger when
-     * long press is detected.
-     * @param animateForward Whether we are going towards the new stashed state or returning to the
-     *                       unstashed state.
-     */
-    public void startStashHint(boolean animateForward) {
-        if (isStashed() || !supportsManualStashing()) {
-            // Already stashed, no need to hint in that direction.
-            return;
-        }
-        mIconScaleForStash.animateToValue(
-                animateForward ? STASHED_TASKBAR_HINT_SCALE : 1)
-                .setDuration(TASKBAR_HINT_STASH_DURATION).start();
-    }
 
     /**
      * Creates and starts a partial unstash animation, hinting at the new state that will trigger
@@ -932,19 +817,12 @@
      *
      * @param animateForward Whether we are going towards the new unstashed state or returning to
      *                       the stashed state.
-     * @param forceUnstash Whether we force the unstash hint to animate.
      */
-    protected void startUnstashHint(boolean animateForward, boolean forceUnstash) {
+    protected void startUnstashHint(boolean animateForward) {
         if (!isStashed()) {
             // Already unstashed, no need to hint in that direction.
             return;
         }
-        // TODO(b/270395798): Clean up after removing long-press unstashing code path.
-        if (!canCurrentlyManuallyUnstash() && !forceUnstash) {
-            // If any other flags are causing us to be stashed, long press won't cause us to
-            // unstash, so don't hint that it will.
-            return;
-        }
         mTaskbarStashedHandleHintScale.animateToValue(
                 animateForward ? UNSTASHED_TASKBAR_HANDLE_HINT_SCALE : 1)
                 .setDuration(TASKBAR_HINT_STASH_DURATION).start();
@@ -1097,13 +975,6 @@
             mControllers.taskbarAutohideSuspendController.updateFlag(
                     TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_IN_LAUNCHER, !isInApp());
         }
-        if (hasAnyFlag(changedFlags, FLAG_STASHED_IN_APP_MANUAL)) {
-            if (hasAnyFlag(FLAG_STASHED_IN_APP_MANUAL)) {
-                mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_LONGPRESS_HIDE);
-            } else {
-                mActivity.getStatsLogManager().logger().log(LAUNCHER_TASKBAR_LONGPRESS_SHOW);
-            }
-        }
         if (hasAnyFlag(changedFlags, FLAG_STASHED_IN_APP_AUTO)) {
             mActivity.getStatsLogManager().logger().log(hasAnyFlag(FLAG_STASHED_IN_APP_AUTO)
                     ? LAUNCHER_TRANSIENT_TASKBAR_HIDE
@@ -1227,7 +1098,6 @@
     private static String getStateString(int flags) {
         StringJoiner sj = new StringJoiner("|");
         appendFlag(sj, flags, FLAGS_IN_APP, "FLAG_IN_APP");
-        appendFlag(sj, flags, FLAG_STASHED_IN_APP_MANUAL, "FLAG_STASHED_IN_APP_MANUAL");
         appendFlag(sj, flags, FLAG_STASHED_IN_APP_SYSUI, "FLAG_STASHED_IN_APP_SYSUI");
         appendFlag(sj, flags, FLAG_STASHED_IN_APP_SETUP, "FLAG_STASHED_IN_APP_SETUP");
         appendFlag(sj, flags, FLAG_STASHED_IN_APP_IME, "FLAG_STASHED_IN_APP_IME");
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index 1be1798..bfbc896 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -261,8 +261,6 @@
         mIconClickListener = mControllerCallbacks.getIconOnClickListener();
         mIconLongClickListener = mControllerCallbacks.getIconOnLongClickListener();
 
-        setOnLongClickListener(mControllerCallbacks.getBackgroundOnLongClickListener());
-
         if (mAllAppsButton != null) {
             mAllAppsButton.setOnClickListener(mControllerCallbacks.getAllAppsButtonClickListener());
         }
@@ -513,24 +511,6 @@
         }
     }
 
-    @Override
-    public boolean onTouchEvent(MotionEvent event) {
-        if (mIconLayoutBounds.left <= event.getX() && event.getX() <= mIconLayoutBounds.right) {
-            // Don't allow long pressing between icons, or above/below them.
-            return true;
-        }
-        if (mControllerCallbacks.onTouchEvent(event)) {
-            int oldAction = event.getAction();
-            try {
-                event.setAction(MotionEvent.ACTION_CANCEL);
-                return super.onTouchEvent(event);
-            } finally {
-                event.setAction(oldAction);
-            }
-        }
-        return super.onTouchEvent(event);
-    }
-
     /**
      * Returns whether the given MotionEvent, *in screen coorindates*, is within any Taskbar item's
      * touch bounds.
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 8a7a98c..14ab471 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -22,7 +22,6 @@
 import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
 import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
 import static com.android.launcher3.Utilities.mapRange;
-import static com.android.launcher3.Utilities.squaredHypot;
 import static com.android.launcher3.anim.AnimatedFloat.VALUE;
 import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
 import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
@@ -899,53 +898,12 @@
             return mControllers.taskbarDragController::startDragOnLongClick;
         }
 
-        public View.OnLongClickListener getBackgroundOnLongClickListener() {
-            return view -> mControllers.taskbarStashController
-                    .updateAndAnimateIsManuallyStashedInApp(true);
-        }
-
         /** Gets the hover listener for the provided icon view. */
         public View.OnHoverListener getIconOnHoverListener(View icon) {
             return new TaskbarHoverToolTipController(mActivity, mTaskbarView, icon);
         }
 
         /**
-         * Get the first chance to handle TaskbarView#onTouchEvent, and return whether we want to
-         * consume the touch so TaskbarView treats it as an ACTION_CANCEL.
-         * TODO(b/270395798): We can remove this entirely once we remove the Transient Taskbar flag.
-         */
-        public boolean onTouchEvent(MotionEvent motionEvent) {
-            final float x = motionEvent.getRawX();
-            final float y = motionEvent.getRawY();
-            switch (motionEvent.getAction()) {
-                case MotionEvent.ACTION_DOWN:
-                    mDownX = x;
-                    mDownY = y;
-                    mControllers.taskbarStashController.startStashHint(/* animateForward = */ true);
-                    mCanceledStashHint = false;
-                    break;
-                case MotionEvent.ACTION_MOVE:
-                    if (!mCanceledStashHint
-                            && squaredHypot(mDownX - x, mDownY - y) > mSquaredTouchSlop) {
-                        mControllers.taskbarStashController.startStashHint(
-                                /* animateForward= */ false);
-                        mCanceledStashHint = true;
-                        return true;
-                    }
-                    break;
-                case MotionEvent.ACTION_UP:
-                case MotionEvent.ACTION_CANCEL:
-                    if (!mCanceledStashHint) {
-                        mControllers.taskbarStashController.startStashHint(
-                                /* animateForward= */ false);
-                    }
-                    break;
-            }
-
-            return false;
-        }
-
-        /**
          * Notifies launcher to update icon alignment.
          */
         public void notifyIconLayoutBoundsChanged() {
diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index f801b3b..0303791 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -82,27 +82,11 @@
                 return response;
             }
 
-            case TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING:
-                runOnTISBinder(tisBinder -> {
-                    enableManualTaskbarStashing(tisBinder, true);
-                });
-                return response;
-
-            case TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING:
-                runOnTISBinder(tisBinder -> {
-                    enableManualTaskbarStashing(tisBinder, false);
-                });
-                return response;
-
             case TestProtocol.REQUEST_UNSTASH_TASKBAR_IF_STASHED:
                 runOnTISBinder(tisBinder -> {
-                    enableManualTaskbarStashing(tisBinder, true);
-
                     // Allow null-pointer to catch illegal states.
                     tisBinder.getTaskbarManager().getCurrentActivityContext()
                             .unstashTaskbarIfStashed();
-
-                    enableManualTaskbarStashing(tisBinder, false);
                 });
                 return response;
 
@@ -187,13 +171,6 @@
         return super.isLauncherInitialized() && TouchInteractionService.isInitialized();
     }
 
-    private void enableManualTaskbarStashing(
-            TouchInteractionService.TISBinder tisBinder, boolean enable) {
-        // Allow null-pointer to catch illegal states.
-        tisBinder.getTaskbarManager().getCurrentActivityContext().enableManualStashingDuringTests(
-                enable);
-    }
-
     private void enableBlockingTimeout(
             TouchInteractionService.TISBinder tisBinder, boolean enable) {
         TaskbarActivityContext context = tisBinder.getTaskbarManager().getCurrentActivityContext();
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java
index 12a8bd9..cd180ba 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarUnstashInputConsumer.java
@@ -22,15 +22,12 @@
 
 import static com.android.launcher3.Flags.enableCursorHoverStates;
 import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent;
-import static com.android.launcher3.Utilities.squaredHypot;
 import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING;
 
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.PointF;
 import android.graphics.Rect;
-import android.view.GestureDetector;
-import android.view.GestureDetector.SimpleOnGestureListener;
 import android.view.InputDevice;
 import android.view.MotionEvent;
 import android.view.ViewConfiguration;
@@ -39,7 +36,6 @@
 
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
 import com.android.launcher3.taskbar.TaskbarActivityContext;
 import com.android.launcher3.taskbar.TaskbarThresholdUtils;
 import com.android.launcher3.taskbar.TaskbarTranslationController.TransitionCallback;
@@ -51,22 +47,13 @@
 import com.android.systemui.shared.system.InputMonitorCompat;
 
 /**
- * Listens for touch and hover events to unstash the Taskbar.
- *
- * <p>Cancels the current gesture if the long press causes the Taskbar to be unstashed.
+ * Listens for touch (swipe) and hover events to unstash the Taskbar.
  */
 public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
 
     private final TaskbarActivityContext mTaskbarActivityContext;
     private final OverviewCommandHelper mOverviewCommandHelper;
-    private final GestureDetector mLongPressDetector;
-    private final float mSquaredTouchSlop;
-
-    private float mLongPressDownX, mLongPressDownY;
-    private boolean mCanceledUnstashHint;
     private final float mUnstashArea;
-    private final float mScreenWidth;
-
     private final int mTaskbarNavThreshold;
     private final int mTaskbarNavThresholdY;
     private final boolean mIsTaskbarAllAppsOpen;
@@ -96,10 +83,7 @@
         super(delegate, inputMonitor);
         mTaskbarActivityContext = taskbarActivityContext;
         mOverviewCommandHelper = overviewCommandHelper;
-        // TODO(b/270395798): remove this when cleaning up old Persistent Taskbar code.
-        mSquaredTouchSlop = Utilities.squaredTouchSlop(context);
         mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
-        mScreenWidth = taskbarActivityContext.getDeviceProfile().widthPx;
 
         Resources res = context.getResources();
         mUnstashArea = res.getDimensionPixelSize(R.dimen.taskbar_unstash_input_area);
@@ -111,13 +95,6 @@
 
         mIsTransientTaskbar = DisplayController.isTransientTaskbar(context);
 
-        mLongPressDetector = new GestureDetector(context, new SimpleOnGestureListener() {
-            @Override
-            public void onLongPress(MotionEvent motionEvent) {
-                onLongPressDetected(motionEvent);
-            }
-        });
-
         mBottomScreenEdge = res.getDimensionPixelSize(
                 R.dimen.taskbar_stashed_screen_edge_hover_deadzone_height);
         mStashedTaskbarBottomEdge =
@@ -135,7 +112,6 @@
 
     @Override
     public void onMotionEvent(MotionEvent ev) {
-        mLongPressDetector.onTouchEvent(ev);
         if (mState != STATE_ACTIVE) {
             boolean isStashedTaskbarHovered = isMouseEvent(ev)
                     && isStashedTaskbarHovered((int) ev.getX(), (int) ev.getY());
@@ -152,15 +128,6 @@
                         mHasPassedTaskbarNavThreshold = false;
                         mTaskbarActivityContext.setAutohideSuspendFlag(
                                 FLAG_AUTOHIDE_SUSPEND_TOUCHING, true);
-                        if (isInTaskbarArea(x)) {
-                            if (!mIsTransientTaskbar) {
-                                mLongPressDownX = x;
-                                mLongPressDownY = y;
-                                mTaskbarActivityContext.startTaskbarUnstashHint(
-                                        /* animateForward = */ true);
-                                mCanceledUnstashHint = false;
-                            }
-                        }
                         if (mTransitionCallback != null && !mIsTaskbarAllAppsOpen) {
                             mTransitionCallback.onActionDown();
                         }
@@ -181,15 +148,6 @@
                         }
                         break;
                     case MotionEvent.ACTION_MOVE:
-                        if (!mIsTransientTaskbar
-                                && !mCanceledUnstashHint
-                                && squaredHypot(mLongPressDownX - x, mLongPressDownY - y)
-                                > mSquaredTouchSlop) {
-                            mTaskbarActivityContext.startTaskbarUnstashHint(
-                                    /* animateForward = */ false);
-                            mCanceledUnstashHint = true;
-                        }
-
                         int pointerIndex = ev.findPointerIndex(mActivePointerId);
                         if (pointerIndex == INVALID_POINTER_ID) {
                             break;
@@ -283,10 +241,6 @@
     }
 
     private void cleanupAfterMotionEvent() {
-        if (!mIsTransientTaskbar && !mCanceledUnstashHint) {
-            mTaskbarActivityContext.startTaskbarUnstashHint(
-                    /* animateForward = */ false);
-        }
         mTaskbarActivityContext.setAutohideSuspendFlag(
                 FLAG_AUTOHIDE_SUSPEND_TOUCHING, false);
         if (mTransitionCallback != null) {
@@ -298,12 +252,6 @@
         mIsPassedBubbleBarSlop = false;
     }
 
-    private boolean isInTaskbarArea(float x) {
-        float areaFromMiddle = mUnstashArea / 2.0f;
-        float distFromMiddle = Math.abs(mScreenWidth / 2.0f - x);
-        return distFromMiddle < areaFromMiddle;
-    }
-
     private boolean isInBubbleBarArea(float x) {
         if (mTaskbarActivityContext == null || !mIsTransientTaskbar) {
             return false;
@@ -320,17 +268,6 @@
         }
     }
 
-    private void onLongPressDetected(MotionEvent motionEvent) {
-        if (mTaskbarActivityContext != null
-                && isInTaskbarArea(motionEvent.getRawX())
-                && !mIsTransientTaskbar) {
-            boolean taskBarPressed = mTaskbarActivityContext.onLongPressToUnstashTaskbar();
-            if (taskBarPressed) {
-                setActive(motionEvent);
-            }
-        }
-    }
-
     /**
      * Listen for hover events for the stashed taskbar.
      *
@@ -389,7 +326,7 @@
     }
 
     private void startStashedTaskbarHover(boolean isHovered) {
-        mTaskbarActivityContext.startTaskbarUnstashHint(isHovered, /* forceUnstash = */ true);
+        mTaskbarActivityContext.startTaskbarUnstashHint(isHovered);
         mIsStashedTaskbarHovered = isHovered;
     }
 
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 746f1cf..7cc3ad7 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -219,9 +219,6 @@
     public static final BooleanFlag NOTIFY_CRASHES = getDebugFlag(270393108, "NOTIFY_CRASHES",
             TEAMFOOD, "Sends a notification whenever launcher encounters an uncaught exception.");
 
-    public static final BooleanFlag ENABLE_TRANSIENT_TASKBAR = getDebugFlag(270395798,
-            "ENABLE_TRANSIENT_TASKBAR", ENABLED, "Enables transient taskbar.");
-
     public static final boolean ENABLE_TASKBAR_NAVBAR_UNIFICATION =
             enableTaskbarNavbarUnification();
 
diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java
index f90779c..1207c31 100644
--- a/src/com/android/launcher3/logging/StatsLogManager.java
+++ b/src/com/android/launcher3/logging/StatsLogManager.java
@@ -549,12 +549,6 @@
         @UiEvent(doc = "Launcher item drop failed since there was not enough room on the screen.")
         LAUNCHER_ITEM_DROP_FAILED_INSUFFICIENT_SPACE(872),
 
-        @UiEvent(doc = "User long pressed on the taskbar background to hide the taskbar")
-        LAUNCHER_TASKBAR_LONGPRESS_HIDE(896),
-
-        @UiEvent(doc = "User long pressed on the taskbar gesture handle to show the taskbar")
-        LAUNCHER_TASKBAR_LONGPRESS_SHOW(897),
-
         @UiEvent(doc = "User clicks on the search icon on header to launch search in app.")
         LAUNCHER_ALLAPPS_SEARCHINAPP_LAUNCH(913),
 
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 045ca79..18f583d 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -22,7 +22,6 @@
 import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING;
 import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING_KEY;
 import static com.android.launcher3.Utilities.dpiFromPx;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_TRANSIENT_TASKBAR;
 import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
 import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
 import static com.android.launcher3.util.FlagDebugUtils.appendFlag;
@@ -410,18 +409,19 @@
          * Returns whether taskbar is transient.
          */
         public boolean isTransientTaskbar() {
-            // TODO(b/258604917): Once ENABLE_TASKBAR_PINNING is enabled, remove usage of
-            //  sTransientTaskbarStatusForTests and update test to directly
-            //  toggle shred preference to switch transient taskbar on/of
-            if (!Utilities.isRunningInTestHarness()
-                    && enableTaskbarPinning()
-                    && mIsTaskbarPinned) {
+            if (navigationMode != NavigationMode.NO_BUTTON) {
                 return false;
             }
-            return navigationMode == NavigationMode.NO_BUTTON
-                    && (Utilities.isRunningInTestHarness()
-                    ? sTransientTaskbarStatusForTests
-                    : ENABLE_TRANSIENT_TASKBAR.get() && !mIsTaskbarPinned);
+            if (Utilities.isRunningInTestHarness()) {
+                // TODO(b/258604917): Once ENABLE_TASKBAR_PINNING is enabled, remove usage of
+                //  sTransientTaskbarStatusForTests and update test to directly
+                //  toggle shared preference to switch transient taskbar on/off.
+                return sTransientTaskbarStatusForTests;
+            }
+            if (enableTaskbarPinning()) {
+                return !mIsTaskbarPinned;
+            }
+            return true;
         }
 
         /**
@@ -485,6 +485,7 @@
         pw.println("  currentSize=" + info.currentSize);
         info.mPerDisplayBounds.forEach((key, value) -> pw.println(
                 "  perDisplayBounds - " + key + ": " + value));
+        pw.println("  isTransientTaskbar=" + info.isTransientTaskbar());
     }
 
     /**
diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
index e19905f..fcb5158 100644
--- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
@@ -92,8 +92,6 @@
             "is-launcher-activity-started";
     public static final String REQUEST_FREEZE_APP_LIST = "freeze-app-list";
     public static final String REQUEST_UNFREEZE_APP_LIST = "unfreeze-app-list";
-    public static final String REQUEST_ENABLE_MANUAL_TASKBAR_STASHING = "enable-taskbar-stashing";
-    public static final String REQUEST_DISABLE_MANUAL_TASKBAR_STASHING = "disable-taskbar-stashing";
     public static final String REQUEST_ENABLE_BLOCK_TIMEOUT = "enable-block-timeout";
     public static final String REQUEST_DISABLE_BLOCK_TIMEOUT = "disable-block-timeout";
     public static final String REQUEST_ENABLE_TRANSIENT_TASKBAR = "enable-transient-taskbar";
