diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index f801b3b..221ce48 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -106,10 +106,10 @@
                 });
                 return response;
 
-            case TestProtocol.REQUEST_TASKBAR_FROM_NAV_THRESHOLD: {
+            case TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT: {
                 final Resources resources = mContext.getResources();
                 response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD,
-                        resources.getDimensionPixelSize(R.dimen.taskbar_from_nav_threshold));
+                        resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size));
                 return response;
             }
 
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
index c9e536a..9a2826d 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
@@ -20,10 +20,9 @@
 import androidx.test.filters.LargeTest;
 import androidx.test.runner.AndroidJUnit4;
 
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
-import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
 import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch;
 
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -33,10 +32,17 @@
 
     @Test
     @TaskbarModeSwitch(mode = PERSISTENT)
-    @PortraitLandscape
-    @NavigationModeSwitch
-    public void testTaskbarFillsWidth() {
-        // Width check is performed inside TAPL whenever getTaskbar() is called.
-        getTaskbar();
+    public void testHideShowTaskbar() {
+        getTaskbar().hide();
+        mLauncher.getLaunchedAppState().showTaskbar();
+    }
+
+    @Test
+    @TaskbarModeSwitch(mode = PERSISTENT)
+    @Ignore // b/301575789
+    public void testHideTaskbarPersistsOnRecreate() {
+        getTaskbar().hide();
+        mLauncher.recreateTaskbar();
+        mLauncher.getLaunchedAppState().assertTaskbarHidden();
     }
 }
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index a0651d0..8e142c3 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -18,6 +18,7 @@
 
 import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
 import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;
+import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
 import static com.android.quickstep.TaskbarModeSwitchRule.Mode.TRANSIENT;
 
 import static org.junit.Assert.assertEquals;
@@ -294,7 +295,7 @@
     }
 
     @Test
-    @TaskbarModeSwitch
+    @TaskbarModeSwitch(mode = PERSISTENT)
     public void testQuickSwitchToPreviousAppForTablet() throws Exception {
         assumeTrue(mLauncher.isTablet());
         startTestActivity(2);
@@ -303,33 +304,22 @@
         // Set ignoreTaskbarVisibility to true to verify the task bar visibility explicitly.
         mLauncher.setIgnoreTaskbarVisibility(true);
 
-
-        try {
-            boolean isTransientTaskbar = mLauncher.isTransientTaskbar();
-            // Expect task bar invisible when the launched app was the IME activity.
-            LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
-            if (!isTransientTaskbar && isHardwareKeyboard()) {
-                launchedAppState.assertTaskbarVisible();
-            } else {
-                launchedAppState.assertTaskbarHidden();
-            }
-
-            // Quick-switch to the test app with swiping to right.
-            quickSwitchToPreviousAppAndAssert(true /* toRight */);
-
-            assertTestActivityIsRunning(2,
-                    "The first app we should have quick switched to is not running");
-            launchedAppState = getAndAssertLaunchedApp();
-            if (isTransientTaskbar) {
-                launchedAppState.assertTaskbarHidden();
-            } else {
-                // Expect taskbar visible when the launched app was the test activity.
-                launchedAppState.assertTaskbarVisible();
-            }
-        } finally {
-            // Reset ignoreTaskbarVisibility to ensure other tests still verify it.
-            mLauncher.setIgnoreTaskbarVisibility(false);
+        // Expect task bar invisible when the launched app was the IME activity.
+        LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
+        if (isHardwareKeyboard()) {
+            launchedAppState.assertTaskbarVisible();
+        } else {
+            launchedAppState.assertTaskbarHidden();
         }
+
+        // Quick-switch to the test app with swiping to right.
+        quickSwitchToPreviousAppAndAssert(true /* toRight */);
+
+        assertTestActivityIsRunning(2,
+                "The first app we should have quick switched to is not running");
+        // Expect task bar visible when the launched app was the test activity.
+        launchedAppState = getAndAssertLaunchedApp();
+        launchedAppState.assertTaskbarVisible();
     }
 
     private boolean isHardwareKeyboard() {
@@ -368,7 +358,7 @@
 
     @Test
     @PortraitLandscape
-    @TaskbarModeSwitch()
+    @TaskbarModeSwitch(mode = PERSISTENT)
     @PlatinumTest(focusArea = "launcher")
     @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/309820115
     @ScreenRecord // b/309820115
@@ -464,7 +454,6 @@
 
     @Test
     @PortraitLandscape
-    @TaskbarModeSwitch
     public void testTaskbarDeadzonesForTablet() throws Exception {
         assumeTrue(mLauncher.isTablet());
 
@@ -477,29 +466,15 @@
                 launcher -> assertTrue("Should have at least 3 tasks",
                         getTaskCount(launcher) >= 3));
 
-        if (mLauncher.isTransientTaskbar()) {
-            // On transient taskbar, it should dismiss when tapping outside taskbar bounds.
-            overview.touchTaskbarBottomCorner(/* tapRight= */ false);
-            assertTrue("Launcher internal state should be Normal",
-                    isInState(() -> LauncherState.NORMAL));
+        // On persistent taskbar, it should not dismiss when tapping the taskbar
+        overview.touchTaskbarBottomCorner(/* tapRight= */ false);
+        assertTrue("Launcher internal state should be Overview",
+                isInState(() -> LauncherState.OVERVIEW));
 
-            overview = mLauncher.getWorkspace().switchToOverview();
-
-            // On transient taskbar, it should dismiss when tapping outside taskbar bounds.
-            overview.touchTaskbarBottomCorner(/* tapRight= */ true);
-            assertTrue("Launcher internal state should be Normal",
-                    isInState(() -> LauncherState.NORMAL));
-        } else {
-            // On persistent taskbar, it should not dismiss when tapping the taskbar
-            overview.touchTaskbarBottomCorner(/* tapRight= */ false);
-            assertTrue("Launcher internal state should be Overview",
-                    isInState(() -> LauncherState.OVERVIEW));
-
-            // On persistent taskbar, it should not dismiss when tapping the taskbar
-            overview.touchTaskbarBottomCorner(/* tapRight= */ true);
-            assertTrue("Launcher internal state should be Overview",
-                    isInState(() -> LauncherState.OVERVIEW));
-        }
+        // On persistent taskbar, it should not dismiss when tapping the taskbar
+        overview.touchTaskbarBottomCorner(/* tapRight= */ true);
+        assertTrue("Launcher internal state should be Overview",
+                isInState(() -> LauncherState.OVERVIEW));
     }
 
     @Test
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTransientTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTransientTaskbar.java
index 7109bbf..db23cc0 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsTransientTaskbar.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTransientTaskbar.java
@@ -24,7 +24,6 @@
 import androidx.test.filters.LargeTest;
 import androidx.test.runner.AndroidJUnit4;
 
-import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
 import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch;
 
 import org.junit.Test;
@@ -65,12 +64,4 @@
         getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
         mLauncher.getLaunchedAppState().clickStashedTaskbarToGoHome();
     }
-
-    @Test
-    @TaskbarModeSwitch(mode = TRANSIENT)
-    @PortraitLandscape
-    public void testSwipeToStashAndUnstash() {
-        getTaskbar().swipeDownToStash();
-        mLauncher.getLaunchedAppState().swipeUpToUnstashTaskbar();
-    }
 }
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java
index d9641ad..0438e57 100644
--- a/src/com/android/launcher3/testing/TestInformationHandler.java
+++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -47,7 +47,6 @@
 import com.android.launcher3.testing.shared.HotseatCellCenterRequest;
 import com.android.launcher3.testing.shared.TestProtocol;
 import com.android.launcher3.testing.shared.WorkspaceCellCenterRequest;
-import com.android.launcher3.util.DisplayController;
 import com.android.launcher3.util.ResourceBasedOverride;
 import com.android.launcher3.widget.picker.WidgetsFullSheet;
 
@@ -171,11 +170,6 @@
                         mDeviceProfile.numShownAllAppsColumns);
                 return response;
 
-            case TestProtocol.REQUEST_IS_TRANSIENT_TASKBAR:
-                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
-                        DisplayController.isTransientTaskbar(mContext));
-                return response;
-
             case TestProtocol.REQUEST_IS_TWO_PANELS:
                 response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
                         FOLDABLE_SINGLE_PAGE.get() ? false : mDeviceProfile.isTwoPanels);
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 045ca79..4c83668 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -71,7 +71,7 @@
 
     private static final String TAG = "DisplayController";
     private static final boolean DEBUG = false;
-    private static boolean sTransientTaskbarStatusForTests = true;
+    private static boolean sTransientTaskbarStatusForTests;
 
     // TODO(b/254119092) remove all logs with this tag
     public static final String TASKBAR_NOT_DESTROYED_TAG = "b/254119092";
diff --git a/src/com/android/launcher3/views/BaseDragLayer.java b/src/com/android/launcher3/views/BaseDragLayer.java
index a1cd697..e4df413 100644
--- a/src/com/android/launcher3/views/BaseDragLayer.java
+++ b/src/com/android/launcher3/views/BaseDragLayer.java
@@ -41,7 +41,6 @@
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.InsettableFrameLayout;
 import com.android.launcher3.Utilities;
-import com.android.launcher3.testing.shared.ResourceUtils;
 import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
 import com.android.launcher3.util.MultiValueAlpha;
 import com.android.launcher3.util.TouchController;
@@ -560,8 +559,7 @@
             DeviceProfile dp = mActivity.getDeviceProfile();
             if (dp.isTaskbarPresent) {
                 // Ignore taskbar gesture insets to avoid interfering with TouchControllers.
-                gestureInsetBottom = ResourceUtils.getNavbarSize(
-                        ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, getResources());
+                gestureInsetBottom = Math.max(0, gestureInsetBottom - dp.taskbarHeight);
             }
             mSystemGestureRegion.set(
                     Math.max(gestureInsets.left, imeInset.left),
diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
index 26169b8..e1b06a8 100644
--- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
@@ -93,9 +93,8 @@
     public static final String REQUEST_DISABLE_BLOCK_TIMEOUT = "disable-block-timeout";
     public static final String REQUEST_ENABLE_TRANSIENT_TASKBAR = "enable-transient-taskbar";
     public static final String REQUEST_DISABLE_TRANSIENT_TASKBAR = "disable-transient-taskbar";
-    public static final String REQUEST_IS_TRANSIENT_TASKBAR = "is-transient-taskbar";
     public static final String REQUEST_UNSTASH_TASKBAR_IF_STASHED = "unstash-taskbar-if-stashed";
-    public static final String REQUEST_TASKBAR_FROM_NAV_THRESHOLD = "taskbar-from-nav-threshold";
+    public static final String REQUEST_STASHED_TASKBAR_HEIGHT = "stashed-taskbar-height";
     public static final String REQUEST_STASHED_TASKBAR_SCALE = "taskbar-stash-handle-scale";
     public static final String REQUEST_RECREATE_TASKBAR = "recreate-taskbar";
     public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags";
diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
index b6b4a47..44869be 100644
--- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
+++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
@@ -186,14 +186,7 @@
         try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
             Taskbar taskbar = new Taskbar(mLauncher);
             taskbar.touchBottomCorner(tapRight);
-            if (mLauncher.isTransientTaskbar()) {
-                // Tapping outside Transient Taskbar returns to Workspace, wait for that state.
-                new Workspace(mLauncher);
-            } else {
-                // Should stay in Overview.
-                verifyActiveContainer();
-                verifyActionsViewVisibility();
-            }
+            verifyActiveContainer();
         }
     }
 
diff --git a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
index 6d58a35..efeb5f6 100644
--- a/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
+++ b/tests/tapl/com/android/launcher3/tapl/LaunchedAppState.java
@@ -20,11 +20,12 @@
 import static com.android.launcher3.tapl.LauncherInstrumentation.TASKBAR_RES_ID;
 import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS;
 import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_DISABLE_BLOCK_TIMEOUT;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
 import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_BLOCK_TIMEOUT;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
 import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_SHELL_DRAG_READY;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_STASHED_TASKBAR_HEIGHT;
 import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_STASHED_TASKBAR_SCALE;
-import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_TASKBAR_FROM_NAV_THRESHOLD;
-import static com.android.launcher3.testing.shared.TestProtocol.TEST_INFO_RESPONSE_FIELD;
 
 import android.graphics.Point;
 import android.graphics.Rect;
@@ -83,6 +84,8 @@
     public Taskbar getTaskbar() {
         try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                 "want to get the taskbar")) {
+            mLauncher.waitForSystemLauncherObject(TASKBAR_RES_ID);
+
             return new Taskbar(mLauncher);
         }
     }
@@ -110,32 +113,37 @@
     /**
      * Returns the Taskbar in a visible state.
      *
-     * The taskbar must already be hidden and in transient mode when calling this method.
+     * The taskbar must already be hidden when calling this method.
      */
-    public Taskbar swipeUpToUnstashTaskbar() {
-        mLauncher.assertTrue("Taskbar is not transient, swipe up not supported",
-                mLauncher.isTransientTaskbar());
-
+    public Taskbar showTaskbar() {
+        mLauncher.getTestInfo(REQUEST_ENABLE_MANUAL_TASKBAR_STASHING);
         mLauncher.getTestInfo(REQUEST_ENABLE_BLOCK_TIMEOUT);
 
         try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
              LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
-                     "want to swipe up to unstash the taskbar")) {
+                     "want to show the taskbar")) {
             mLauncher.waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
 
-            int taskbarFromNavThreshold = mLauncher.getTestInfo(REQUEST_TASKBAR_FROM_NAV_THRESHOLD)
-                    .getInt(TEST_INFO_RESPONSE_FIELD);
-            int startX = mLauncher.getRealDisplaySize().x / 2;
-            int startY = mLauncher.getRealDisplaySize().y - 1;
-            int endX = startX;
-            int endY = startY - taskbarFromNavThreshold;
+            final long downTime = SystemClock.uptimeMillis();
+            final int unstashTargetY = mLauncher.getRealDisplaySize().y
+                    - (mLauncher.getTestInfo(REQUEST_STASHED_TASKBAR_HEIGHT)
+                            .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD) / 2);
+            final Point unstashTarget = new Point(
+                    mLauncher.getRealDisplaySize().x / 2, unstashTargetY);
 
-            mLauncher.linearGesture(startX, startY, endX, endY, 10, /* slowDown= */ true,
+            mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, unstashTarget,
                     LauncherInstrumentation.GestureScope.EXPECT_PILFER);
-            LauncherInstrumentation.log("swipeUpToUnstashTaskbar: sent linear swipe up gesture");
+            LauncherInstrumentation.log("showTaskbar: sent down");
 
-            return new Taskbar(mLauncher);
+            try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("pressed down")) {
+                mLauncher.waitForSystemLauncherObject(TASKBAR_RES_ID);
+                mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_UP, unstashTarget,
+                        LauncherInstrumentation.GestureScope.EXPECT_PILFER);
+
+                return new Taskbar(mLauncher);
+            }
         } finally {
+            mLauncher.getTestInfo(REQUEST_DISABLE_MANUAL_TASKBAR_STASHING);
             mLauncher.getTestInfo(REQUEST_DISABLE_BLOCK_TIMEOUT);
         }
     }
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 682a36d..720c8e5 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -825,7 +825,12 @@
                     waitUntilSystemLauncherObjectGone(OVERVIEW_RES_ID);
                     waitUntilSystemLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
                     waitUntilLauncherObjectGone(KEYBOARD_QUICK_SWITCH_RES_ID);
-                    waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
+
+                    if (is3PLauncher() && isTablet()) {
+                        waitForSystemLauncherObject(TASKBAR_RES_ID);
+                    } else {
+                        waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
+                    }
 
                     return waitForLauncherObject(WORKSPACE_RES_ID);
                 }
@@ -835,7 +840,12 @@
                     waitUntilSystemLauncherObjectGone(OVERVIEW_RES_ID);
                     waitUntilSystemLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
                     waitUntilLauncherObjectGone(KEYBOARD_QUICK_SWITCH_RES_ID);
-                    waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
+
+                    if (is3PLauncher() && isTablet()) {
+                        waitForSystemLauncherObject(TASKBAR_RES_ID);
+                    } else {
+                        waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
+                    }
 
                     return waitForLauncherObject(WIDGETS_RES_ID);
                 }
@@ -856,7 +866,7 @@
                     waitUntilSystemLauncherObjectGone(SPLIT_PLACEHOLDER_RES_ID);
                     waitUntilLauncherObjectGone(KEYBOARD_QUICK_SWITCH_RES_ID);
 
-                    if (is3PLauncher() && isTablet() && !isTransientTaskbar()) {
+                    if (is3PLauncher() && isTablet()) {
                         waitForSystemLauncherObject(TASKBAR_RES_ID);
                     } else {
                         waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
@@ -869,7 +879,7 @@
                     waitUntilLauncherObjectGone(APPS_RES_ID);
                     waitUntilLauncherObjectGone(WORKSPACE_RES_ID);
                     waitUntilLauncherObjectGone(WIDGETS_RES_ID);
-                    if (isTablet() && !is3PLauncher()) {
+                    if (isTablet()) {
                         waitForSystemLauncherObject(TASKBAR_RES_ID);
                     } else {
                         waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
@@ -906,11 +916,7 @@
                     }
 
                     if (isTablet()) {
-                        // Only check that Persistent Taskbar is visible, since Transient Taskbar
-                        // may or may not be visible by design.
-                        if (!isTransientTaskbar()) {
-                            waitForSystemLauncherObject(TASKBAR_RES_ID);
-                        }
+                        waitForSystemLauncherObject(TASKBAR_RES_ID);
                     } else {
                         waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
                     }
@@ -984,7 +990,7 @@
     /**
      * Using swiping up gesture to dismiss closable floating views, such as Menu or Folder Content.
      */
-    private void swipeUpToCloseFloatingView() {
+    private void swipeUpToCloseFloatingView(boolean gestureStartFromLauncher) {
         final Point displaySize = getRealDisplaySize();
 
         final Optional<String> floatingRes = getFloatingResId();
@@ -993,11 +999,16 @@
             return;
         }
 
+        GestureScope gestureScope = gestureStartFromLauncher
+                // Without the navigation bar layer, the gesture scope on tablets remains inside the
+                // launcher process.
+                ? (isTablet() ? GestureScope.DONT_EXPECT_PILFER : GestureScope.EXPECT_PILFER)
+                : GestureScope.EXPECT_PILFER;
         linearGesture(
                 displaySize.x / 2, displaySize.y - 1,
                 displaySize.x / 2, 0,
                 ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME,
-                false, GestureScope.EXPECT_PILFER);
+                false, gestureScope);
 
         try (LauncherInstrumentation.Closable c1 = addContextLayer(
                 String.format("Swiped up from floating view %s to home", floatingRes.get()))) {
@@ -1065,8 +1076,11 @@
 
                 final Point displaySize = getRealDisplaySize();
 
+                boolean gestureStartFromLauncher =
+                        isTablet() ? !isLauncher3() : isLauncherVisible();
+
                 // CLose floating views before going back to home.
-                swipeUpToCloseFloatingView();
+                swipeUpToCloseFloatingView(gestureStartFromLauncher);
 
                 if (hasLauncherObject(WORKSPACE_RES_ID)) {
                     log(action = "already at home");
@@ -2001,7 +2015,6 @@
         }
     }
 
-    /** Returns the bounds of the display as a Point where x is width and y is height. */
     Point getRealDisplaySize() {
         final Rect displayBounds = getContext().getSystemService(WindowManager.class)
                 .getMaximumWindowMetrics()
@@ -2064,11 +2077,6 @@
                 : TestProtocol.REQUEST_DISABLE_BLOCK_TIMEOUT);
     }
 
-    public boolean isTransientTaskbar() {
-        return getTestInfo(TestProtocol.REQUEST_IS_TRANSIENT_TASKBAR)
-                .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD);
-    }
-
     /** Enables transient taskbar for testing purposes only. */
     public void enableTransientTaskbar(boolean enable) {
         getTestInfo(enable
diff --git a/tests/tapl/com/android/launcher3/tapl/Taskbar.java b/tests/tapl/com/android/launcher3/tapl/Taskbar.java
index a202c53..da26694 100644
--- a/tests/tapl/com/android/launcher3/tapl/Taskbar.java
+++ b/tests/tapl/com/android/launcher3/tapl/Taskbar.java
@@ -18,6 +18,8 @@
 import static android.view.KeyEvent.KEYCODE_META_RIGHT;
 
 import static com.android.launcher3.tapl.LauncherInstrumentation.TASKBAR_RES_ID;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_DISABLE_MANUAL_TASKBAR_STASHING;
+import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_ENABLE_MANUAL_TASKBAR_STASHING;
 
 import android.graphics.Point;
 import android.graphics.Rect;
@@ -31,8 +33,6 @@
 import androidx.test.uiautomator.BySelector;
 import androidx.test.uiautomator.UiObject2;
 
-import org.junit.Assert;
-
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -45,15 +45,6 @@
 
     Taskbar(LauncherInstrumentation launcher) {
         mLauncher = launcher;
-        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
-                "expect new taskbar to be visible")) {
-            mLauncher.waitForSystemLauncherObject(TASKBAR_RES_ID);
-        }
-
-        if (!mLauncher.isTransientTaskbar()) {
-            Assert.assertEquals("Persistent taskbar should fill screen width",
-                    getVisibleBounds().width(), mLauncher.getRealDisplaySize().x);
-        }
     }
 
     /**
@@ -70,32 +61,33 @@
     }
 
     /**
-     * Stashes this taskbar.
-     * <p>
-     * The taskbar must already be unstashed and in transient mode when calling this method.
+     * Hides this taskbar.
+     *
+     * The taskbar must already be visible when calling this method.
      */
-    public void swipeDownToStash() {
-        mLauncher.assertTrue("Taskbar is not transient, swipe down not supported",
-                mLauncher.isTransientTaskbar());
+    public void hide() {
+        mLauncher.getTestInfo(REQUEST_ENABLE_MANUAL_TASKBAR_STASHING);
 
         try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                 "want to hide the taskbar");
              LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
             mLauncher.waitForSystemLauncherObject(TASKBAR_RES_ID);
 
-            Rect taskbarBounds = getVisibleBounds();
-            int startX = taskbarBounds.centerX();
-            int startY = taskbarBounds.centerY();
-            int endX = startX;
-            int endY = mLauncher.getRealDisplaySize().y - 1;
+            final long downTime = SystemClock.uptimeMillis();
+            Point stashTarget = new Point(
+                    mLauncher.getRealDisplaySize().x - 1, mLauncher.getRealDisplaySize().y - 1);
 
-            mLauncher.linearGesture(startX, startY, endX, endY, 10, false,
+            mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, stashTarget,
                     LauncherInstrumentation.GestureScope.DONT_EXPECT_PILFER);
-            LauncherInstrumentation.log("swipeDownToStash: sent linear swipe down gesture");
-            try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
-                    "expect transient taskbar to be hidden after swipe down")) {
+            LauncherInstrumentation.log("hideTaskbar: sent down");
+
+            try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("pressed down")) {
                 mLauncher.waitUntilSystemLauncherObjectGone(TASKBAR_RES_ID);
+                mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_UP, stashTarget,
+                        LauncherInstrumentation.GestureScope.DONT_EXPECT_PILFER);
             }
+        } finally {
+            mLauncher.getTestInfo(REQUEST_DISABLE_MANUAL_TASKBAR_STASHING);
         }
     }
 
