Merge "Update stashed handle region to only include the handle" into sc-v2-dev
diff --git a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
index dacd8a2..0f61d14 100644
--- a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
+++ b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
@@ -18,6 +18,8 @@
 
 import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
 
+import android.app.Activity;
+import android.app.Application;
 import android.content.Context;
 import android.os.Binder;
 import android.os.Bundle;
@@ -31,7 +33,10 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.LinkedList;
+import java.util.Map;
+import java.util.WeakHashMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
@@ -41,9 +46,48 @@
 public class DebugTestInformationHandler extends TestInformationHandler {
     private static LinkedList sLeaks;
     private static Collection<String> sEvents;
+    private static Application.ActivityLifecycleCallbacks sActivityLifecycleCallbacks;
+    private static final Map<Activity, Boolean> sActivities =
+            Collections.synchronizedMap(new WeakHashMap<>());
+    private static int sActivitiesCreatedCount = 0;
 
     public DebugTestInformationHandler(Context context) {
         init(context);
+        if (sActivityLifecycleCallbacks == null) {
+            sActivityLifecycleCallbacks = new Application.ActivityLifecycleCallbacks() {
+                @Override
+                public void onActivityCreated(Activity activity, Bundle bundle) {
+                    sActivities.put(activity, true);
+                    ++sActivitiesCreatedCount;
+                }
+
+                @Override
+                public void onActivityStarted(Activity activity) {
+                }
+
+                @Override
+                public void onActivityResumed(Activity activity) {
+                }
+
+                @Override
+                public void onActivityPaused(Activity activity) {
+                }
+
+                @Override
+                public void onActivityStopped(Activity activity) {
+                }
+
+                @Override
+                public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
+                }
+
+                @Override
+                public void onActivityDestroyed(Activity activity) {
+                }
+            };
+            ((Application) context.getApplicationContext())
+                    .registerActivityLifecycleCallbacks(sActivityLifecycleCallbacks);
+        }
     }
 
     private static void runGcAndFinalizersSync() {
@@ -160,6 +204,20 @@
                 }
             }
 
+            case TestProtocol.REQUEST_GET_ACTIVITIES_CREATED_COUNT: {
+                response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, sActivitiesCreatedCount);
+                return response;
+            }
+
+            case TestProtocol.REQUEST_GET_ACTIVITIES: {
+                response.putStringArray(TestProtocol.TEST_INFO_RESPONSE_FIELD,
+                        sActivities.keySet().stream().map(
+                                a -> a.getClass().getSimpleName() + " ("
+                                        + (a.isDestroyed() ? "destroyed" : "current") + ")")
+                                .toArray(String[]::new));
+                return response;
+            }
+
             default:
                 return super.call(method, arg);
         }
diff --git a/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java b/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java
index 97ba590..492611f 100644
--- a/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/GoOverviewActionsView.java
@@ -117,7 +117,7 @@
      */
     public void updateOrientationState(RecentsOrientedState orientedState) {
         // dismiss tooltip
-        boolean canLauncherRotate = orientedState.canRecentsActivityRotate();
+        boolean canLauncherRotate = orientedState.isRecentsActivityRotationAllowed();
         if (mArrowTipView != null && !canLauncherRotate) {
             mArrowTipView.close(/* animate= */ false);
         }
diff --git a/quickstep/AndroidManifest.xml b/quickstep/AndroidManifest.xml
index bc8bd3a..124cd57 100644
--- a/quickstep/AndroidManifest.xml
+++ b/quickstep/AndroidManifest.xml
@@ -100,7 +100,6 @@
         <activity android:name="com.android.quickstep.interaction.GestureSandboxActivity"
             android:autoRemoveFromRecents="true"
             android:excludeFromRecents="true"
-            android:screenOrientation="portrait"
             android:exported="true">
             <intent-filter>
                 <action android:name="com.android.quickstep.action.GESTURE_SANDBOX"/>
diff --git a/quickstep/res/drawable/default_sandbox_app_previous_task_thumbnail.xml b/quickstep/res/drawable/default_sandbox_app_previous_task_thumbnail.xml
deleted file mode 100644
index 9c95497..0000000
--- a/quickstep/res/drawable/default_sandbox_app_previous_task_thumbnail.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2020 The Android Open Source Project
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-          http://www.apache.org/licenses/LICENSE-2.0
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-    android:shape="rectangle">
-  <solid android:color="@color/gesture_tutorial_fake_previous_task_view_color" />
-</shape>
diff --git a/quickstep/res/layout/gesture_tutorial_fragment.xml b/quickstep/res/layout/gesture_tutorial_fragment.xml
index cfb3eb0..0f01190 100644
--- a/quickstep/res/layout/gesture_tutorial_fragment.xml
+++ b/quickstep/res/layout/gesture_tutorial_fragment.xml
@@ -41,13 +41,54 @@
         android:layout_height="20dp"
         android:visibility="invisible" />
 
-    <View
+    <com.android.quickstep.interaction.AnimatedTaskView
         android:id="@+id/gesture_tutorial_fake_previous_task_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:scaleX="0.98"
         android:scaleY="0.98"
-        android:visibility="invisible" />
+        android:visibility="invisible">
+
+        <View
+            android:id="@+id/full_task_view"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:visibility="invisible"
+
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"/>
+
+        <androidx.cardview.widget.CardView
+            android:id="@+id/top_task_view"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:visibility="invisible"
+            android:layout_marginBottom="@dimen/gesture_tutorial_multi_row_task_view_spacing"
+
+            app:cardElevation="0dp"
+            app:cardCornerRadius="@dimen/gesture_tutorial_small_task_view_corner_radius"
+            app:layout_constraintVertical_chainStyle="spread"
+            app:layout_constraintTop_toTopOf="@id/full_task_view"
+            app:layout_constraintBottom_toTopOf="@id/bottom_task_view"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"/>
+
+        <androidx.cardview.widget.CardView
+            android:id="@+id/bottom_task_view"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:visibility="invisible"
+
+            app:cardElevation="0dp"
+            app:cardCornerRadius="@dimen/gesture_tutorial_small_task_view_corner_radius"
+            app:layout_constraintTop_toBottomOf="@id/top_task_view"
+            app:layout_constraintBottom_toBottomOf="@id/full_task_view"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"/>
+
+    </com.android.quickstep.interaction.AnimatedTaskView>
 
     <FrameLayout
         android:id="@+id/gesture_tutorial_fake_task_view"
diff --git a/quickstep/res/layout/gesture_tutorial_mock_conversation.xml b/quickstep/res/layout/gesture_tutorial_mock_conversation.xml
index 89973d3..9951663 100644
--- a/quickstep/res/layout/gesture_tutorial_mock_conversation.xml
+++ b/quickstep/res/layout/gesture_tutorial_mock_conversation.xml
@@ -118,19 +118,17 @@
 
             <androidx.cardview.widget.CardView
                 android:id="@+id/reply_icon_1"
-                android:layout_width="0dp"
-                android:layout_height="0dp"
+                android:layout_width="44dp"
+                android:layout_height="44dp"
                 android:layout_marginBottom="32dp"
                 android:layout_marginStart="26dp"
-                android:layout_marginEnd="342dp"
 
                 app:cardElevation="0dp"
                 app:cardCornerRadius="100dp"
                 app:cardBackgroundColor="@color/mock_conversation_profile_icon"
                 app:layout_constraintDimensionRatio="1:1"
                 app:layout_constraintBottom_toTopOf="@id/message_2"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintEnd_toEndOf="parent"/>
+                app:layout_constraintStart_toStartOf="parent"/>
 
             <androidx.cardview.widget.CardView
                 android:layout_width="0dp"
@@ -178,19 +176,17 @@
 
             <androidx.cardview.widget.CardView
                 android:id="@+id/reply_icon_2"
-                android:layout_width="0dp"
-                android:layout_height="0dp"
+                android:layout_width="44dp"
+                android:layout_height="44dp"
                 android:layout_marginBottom="32dp"
                 android:layout_marginStart="26dp"
-                android:layout_marginEnd="342dp"
 
                 app:cardElevation="0dp"
                 app:cardCornerRadius="100dp"
                 app:cardBackgroundColor="@color/mock_conversation_profile_icon"
                 app:layout_constraintDimensionRatio="1:1"
                 app:layout_constraintBottom_toTopOf="@id/message_4"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintEnd_toEndOf="parent"/>
+                app:layout_constraintStart_toStartOf="parent"/>
 
             <androidx.cardview.widget.CardView
                 android:layout_width="0dp"
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 38c202b..e903377 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -121,6 +121,8 @@
     <dimen name="gesture_tutorial_subtitle_margin_start_end">16dp</dimen>
     <dimen name="gesture_tutorial_feedback_margin_start_end">24dp</dimen>
     <dimen name="gesture_tutorial_button_margin_start_end">18dp</dimen>
+    <dimen name="gesture_tutorial_multi_row_task_view_spacing">72dp</dimen>
+    <dimen name="gesture_tutorial_small_task_view_corner_radius">18dp</dimen>
 
     <!-- All Set page -->
     <dimen name="allset_page_margin_horizontal">40dp</dimen>
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index 7158287..52bd48b 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -193,6 +193,8 @@
     <string name="action_screenshot">Screenshot</string>
     <!-- Label for a button that enters split screen selection mode. [CHAR_LIMIT=20] -->
     <string name="action_split">Split</string>
+    <!-- Label for toast with instructions for split screen selection mode. [CHAR_LIMIT=50] -->
+    <string name="toast_split_select_app">Tap another app to use splitscreen</string>
     <!-- Message shown when an action is blocked by a policy enforced by the app or the organization managing the device. [CHAR_LIMIT=NONE] -->
     <string name="blocked_by_policy">This action isn\'t allowed by the app or your organization</string>
 
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index b8ce818..a68322d 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -85,7 +85,6 @@
 import com.android.quickstep.util.SplitSelectStateController;
 import com.android.quickstep.views.OverviewActionsView;
 import com.android.quickstep.views.RecentsView;
-import com.android.quickstep.views.SplitPlaceholderView;
 import com.android.systemui.shared.system.ActivityManagerWrapper;
 import com.android.systemui.shared.system.ActivityOptionsCompat;
 import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
@@ -131,7 +130,7 @@
                 // Seems like there can be a race condition when user unlocks, which kills the TIS
                 // process and re-starts it. I guess in the meantime service can be connected to
                 // a killed TIS? Either way, unbind and try to re-connect in that case.
-                unbindService(mTisBinderConnection);
+                internalUnbindToTIS();
                 mHandler.postDelayed(mConnectionRunnable, BACKOFF_MILLIS);
                 return;
             }
@@ -159,10 +158,10 @@
     private short mConnectionAttempts;
     private final TaskbarStateHandler mTaskbarStateHandler = new TaskbarStateHandler(this);
     private final Handler mHandler = new Handler();
+    private boolean mTisServiceBound;
 
     // Will be updated when dragging from taskbar.
     private @Nullable DragOptions mNextWorkspaceDragOptions = null;
-    private SplitPlaceholderView mSplitPlaceholderView;
 
     private @Nullable UnfoldTransitionProgressProvider mUnfoldTransitionProgressProvider;
     private @Nullable LauncherUnfoldAnimationController mLauncherUnfoldAnimationController;
@@ -202,7 +201,7 @@
 
         SysUINavigationMode.INSTANCE.get(this).removeModeChangeListener(this);
 
-        unbindService(mTisBinderConnection);
+        internalUnbindToTIS();
         if (mTaskbarManager != null) {
             mTaskbarManager.clearLauncher(this);
         }
@@ -363,12 +362,13 @@
 
     /**
      * Binds {@link #mTisBinderConnection} to {@link TouchInteractionService}. If the binding fails,
-     * attempts to retry via {@link #mConnectionRunnable}
+     * attempts to retry via {@link #mConnectionRunnable}.
+     * Unbind via {@link #internalUnbindToTIS()}
      */
     private void internalBindToTIS() {
-        boolean bound = bindService(new Intent(this, TouchInteractionService.class),
+        mTisServiceBound = bindService(new Intent(this, TouchInteractionService.class),
                         mTisBinderConnection, 0);
-        if (bound) {
+        if (mTisServiceBound) {
             resetServiceBindRetryState();
             return;
         }
@@ -380,6 +380,14 @@
         mConnectionAttempts++;
     }
 
+    /** See {@link #internalBindToTIS()} */
+    private void internalUnbindToTIS() {
+        if (mTisServiceBound) {
+            unbindService(mTisBinderConnection);
+            mTisServiceBound = false;
+        }
+    }
+
     private void resetServiceBindRetryState() {
         if (mHandler.hasCallbacks(mConnectionRunnable)) {
             mHandler.removeCallbacks(mConnectionRunnable);
@@ -417,10 +425,6 @@
         return (T) mActionsView;
     }
 
-    public SplitPlaceholderView getSplitPlaceholderView() {
-        return mSplitPlaceholderView;
-    }
-
     @Override
     protected void closeOpenViews(boolean animate) {
         super.closeOpenViews(animate);
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index 2537134..ddb20a1 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -856,7 +856,13 @@
         // Since we added a start delay, call update here to init the FloatingIconView properly.
         listener.onUpdate(0, true /* initOnly */);
 
-        animatorSet.playTogether(appAnimator, getBackgroundAnimator(appTargets));
+        // If app targets are translucent, do not animate the background as it causes a visible
+        // flicker when it resets itself at the end of its animation.
+        if (appTargetsAreTranslucent) {
+            animatorSet.play(appAnimator);
+        } else {
+            animatorSet.playTogether(appAnimator, getBackgroundAnimator());
+        }
         return animatorSet;
     }
 
@@ -993,11 +999,20 @@
             }
         });
 
-        animatorSet.playTogether(appAnimator, getBackgroundAnimator(appTargets));
+        // If app targets are translucent, do not animate the background as it causes a visible
+        // flicker when it resets itself at the end of its animation.
+        if (appTargetsAreTranslucent) {
+            animatorSet.play(appAnimator);
+        } else {
+            animatorSet.playTogether(appAnimator, getBackgroundAnimator());
+        }
         return animatorSet;
     }
 
-    private ObjectAnimator getBackgroundAnimator(RemoteAnimationTargetCompat[] appTargets) {
+    /**
+     * Returns animator that controls depth/blur of the background.
+     */
+    private ObjectAnimator getBackgroundAnimator() {
         // When launching an app from overview that doesn't map to a task, we still want to just
         // blur the wallpaper instead of the launcher surface as well
         boolean allowBlurringLauncher = mLauncher.getStateManager().getState() != OVERVIEW;
@@ -1540,11 +1555,13 @@
             if (anim == null) {
                 anim = new AnimatorSet();
 
-                boolean playFallBackAnimation = mLauncher.isInState(LauncherState.ALL_APPS)
+                View workspaceView = findWorkspaceView(appTargets);
+                boolean isWorkspaceViewVisible = workspaceView != null
+                        && !mLauncher.isInState(LauncherState.ALL_APPS);
+                boolean playFallBackAnimation = !isWorkspaceViewVisible
                         && (launcherIsATargetWithMode(appTargets, MODE_OPENING)
                         || mLauncher.isForceInvisible());
 
-                View workspaceView = findWorkspaceView(appTargets);
                 boolean playWorkspaceReveal = true;
                 if (mFromUnlock) {
                     anim.play(getUnlockWindowAnimator(appTargets, wallpaperTargets));
diff --git a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
index 63a569a..1b0f967 100644
--- a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
+++ b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
@@ -282,8 +282,7 @@
 
     @Override
     public void setInsets(Rect insets, DeviceProfile grid) {
-        int leftRightPadding = grid.desiredWorkspaceLeftRightMarginPx
-                + grid.cellLayoutPaddingLeftRightPx;
+        int leftRightPadding = grid.allAppsLeftRightPadding;
         setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom());
     }
 
diff --git a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
index 5242b3c..9ad8bb2 100644
--- a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
+++ b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
@@ -249,8 +249,7 @@
 
     @Override
     public void setInsets(Rect insets, DeviceProfile grid) {
-        int leftRightPadding = grid.desiredWorkspaceLeftRightMarginPx
-                + grid.cellLayoutPaddingLeftRightPx;
+        int leftRightPadding = grid.allAppsLeftRightPadding;
         setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom());
     }
 
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
index 010f463..37a1674 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
@@ -84,6 +84,8 @@
 
     private TaskView mTaskBeingDragged;
 
+    private boolean mIsDismissHapticRunning = false;
+
     public TaskViewTouchController(T activity) {
         mActivity = activity;
         mRecentsView = activity.getOverviewPanel();
@@ -365,9 +367,10 @@
         mCurrentAnimation.startWithVelocity(mActivity, goingToEnd,
                 velocity * orientationHandler.getSecondaryTranslationDirectionFactor(),
                 mEndDisplacement, animationDuration);
-        if (goingUp && goingToEnd) {
+        if (goingUp && goingToEnd && !mIsDismissHapticRunning) {
             VibratorWrapper.INSTANCE.get(mActivity).vibrate(TASK_DISMISS_VIBRATION_PRIMITIVE,
                     TASK_DISMISS_VIBRATION_PRIMITIVE_SCALE, TASK_DISMISS_VIBRATION_FALLBACK);
+            mIsDismissHapticRunning = true;
         }
     }
 
@@ -376,5 +379,6 @@
         mDetector.setDetectableScrollConditions(0, false);
         mTaskBeingDragged = null;
         mCurrentAnimation = null;
+        mIsDismissHapticRunning = false;
     }
 }
diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
index d531339..cfd330d 100644
--- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
+++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java
@@ -2,6 +2,7 @@
 
 import android.app.Activity;
 import android.content.Context;
+import android.graphics.Rect;
 import android.os.Bundle;
 
 import com.android.launcher3.LauncherState;
@@ -59,9 +60,14 @@
                 return response;
             }
 
-            case TestProtocol.REQUEST_OVERVIEW_CONTENT_PUSH_ENABLED: {
-                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
-                        FeatureFlags.ENABLE_OVERVIEW_CONTENT_PUSH.get());
+            case TestProtocol.REQUEST_GET_FOCUSED_TASK_WIDTH_FOR_TABLET: {
+                if (!mDeviceProfile.isTablet) {
+                    return null;
+                }
+                Rect focusedTaskRect = new Rect();
+                LauncherActivityInterface.INSTANCE.calculateTaskSize(mContext, mDeviceProfile,
+                        focusedTaskRect);
+                response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.width());
                 return response;
             }
         }
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index 085bfbb..7bdc20d 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -86,7 +86,7 @@
             }
         }
         RecentsOrientedState orientedState = taskView.getRecentsView().getPagedViewOrientedState();
-        boolean canLauncherRotate = orientedState.canRecentsActivityRotate();
+        boolean canLauncherRotate = orientedState.isRecentsActivityRotationAllowed();
         boolean isInLandscape = orientedState.getTouchRotation() != ROTATION_0;
 
         // Add overview actions to the menu when in in-place rotate landscape mode.
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverscrollInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverscrollInputConsumer.java
index fb420a2..e984b4f 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OverscrollInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OverscrollInputConsumer.java
@@ -230,9 +230,6 @@
 
         // Make sure there isn't an app to quick switch to on our right
         int maxIndex = 0;
-        if (mRecentsView != null && mRecentsView.hasRecentsExtraCard()) {
-            maxIndex = 1;
-        }
 
         boolean atRightMostApp = mRecentsView == null
                 || (mRecentsView.getRunningTaskIndex() <= maxIndex);
diff --git a/quickstep/src/com/android/quickstep/interaction/AnimatedTaskView.java b/quickstep/src/com/android/quickstep/interaction/AnimatedTaskView.java
new file mode 100644
index 0000000..53ad138
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/interaction/AnimatedTaskView.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.interaction;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
+import android.annotation.ColorInt;
+import android.content.Context;
+import android.graphics.Outline;
+import android.graphics.Rect;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewOutlineProvider;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.cardview.widget.CardView;
+import androidx.constraintlayout.widget.ConstraintLayout;
+
+import com.android.launcher3.R;
+
+import java.util.ArrayList;
+
+/**
+ * Helper View for the gesture tutorial mock previous app task view.
+ *
+ * This helper class allows animating from a single-row layout to a two-row layout as seen in
+ * large screen devices.
+ */
+public class AnimatedTaskView extends ConstraintLayout {
+
+    private View mFullTaskView;
+    private CardView mTopTaskView;
+    private CardView mBottomTaskView;
+
+    private ViewOutlineProvider mTaskViewOutlineProvider = null;
+    private final Rect mTaskViewAnimatedRect = new Rect();
+    private float mTaskViewAnimatedRadius;
+
+    public AnimatedTaskView(@NonNull Context context) {
+        super(context);
+    }
+
+    public AnimatedTaskView(@NonNull Context context,
+            @Nullable AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public AnimatedTaskView(
+            @NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    public AnimatedTaskView(
+            @NonNull Context context,
+            @Nullable AttributeSet attrs,
+            int defStyleAttr,
+            int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+
+        mFullTaskView = findViewById(R.id.full_task_view);
+        mTopTaskView = findViewById(R.id.top_task_view);
+        mBottomTaskView = findViewById(R.id.bottom_task_view);
+
+        setToSingleRowLayout(false);
+    }
+
+    AnimatorSet createAnimationToMultiRowLayout() {
+        if (mTaskViewOutlineProvider == null) {
+            // This is an illegal state.
+            return null;
+        }
+        Outline startOutline = new Outline();
+        mTaskViewOutlineProvider.getOutline(this, startOutline);
+        Rect outlineStartRect = new Rect();
+        startOutline.getRect(outlineStartRect);
+        int endRectBottom = mTopTaskView.getHeight();
+        float outlineStartRadius = startOutline.getRadius();
+        float outlineEndRadius = getContext().getResources().getDimensionPixelSize(
+                R.dimen.gesture_tutorial_small_task_view_corner_radius);
+
+        ValueAnimator outlineAnimator = ValueAnimator.ofFloat(0f, 1f);
+        outlineAnimator.addUpdateListener(valueAnimator -> {
+            float progress = (float) valueAnimator.getAnimatedValue();
+            mTaskViewAnimatedRect.bottom = (int) (outlineStartRect.bottom
+                    + progress * (endRectBottom - outlineStartRect.bottom));
+            mTaskViewAnimatedRadius = outlineStartRadius
+                    + progress * (outlineEndRadius - outlineStartRadius);
+            mFullTaskView.invalidateOutline();
+        });
+        outlineAnimator.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+
+                mTaskViewAnimatedRect.set(outlineStartRect);
+                mTaskViewAnimatedRadius = outlineStartRadius;
+
+                mFullTaskView.setClipToOutline(true);
+                mFullTaskView.setOutlineProvider(new ViewOutlineProvider() {
+                    @Override
+                    public void getOutline(View view, Outline outline) {
+                        outline.setRoundRect(mTaskViewAnimatedRect, mTaskViewAnimatedRadius);
+                    }
+                });
+            }
+
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                super.onAnimationEnd(animation);
+                mFullTaskView.setOutlineProvider(mTaskViewOutlineProvider);
+            }
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                super.onAnimationCancel(animation);
+                mFullTaskView.setOutlineProvider(mTaskViewOutlineProvider);
+            }
+        });
+
+        ArrayList<Animator> animations = new ArrayList<>();
+        animations.add(ObjectAnimator.ofFloat(
+                mBottomTaskView, View.TRANSLATION_X, -mBottomTaskView.getWidth(), 0));
+        animations.add(outlineAnimator);
+
+        AnimatorSet animatorSet = new AnimatorSet();
+        animatorSet.playTogether(animations);
+        animatorSet.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+                setToSingleRowLayout(true);
+
+                setPadding(0, outlineStartRect.top, 0, getHeight() - outlineStartRect.bottom);
+            }
+
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                super.onAnimationEnd(animation);
+                setToMultiRowLayout();
+            }
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                super.onAnimationCancel(animation);
+                setToMultiRowLayout();
+            }
+        });
+
+        return animatorSet;
+    }
+
+    void setToSingleRowLayout(boolean forAnimation) {
+        mFullTaskView.setVisibility(VISIBLE);
+        mTopTaskView.setVisibility(INVISIBLE);
+        mBottomTaskView.setVisibility(forAnimation ? VISIBLE : INVISIBLE);
+    }
+
+    void setToMultiRowLayout() {
+        mFullTaskView.setVisibility(INVISIBLE);
+        mTopTaskView.setVisibility(VISIBLE);
+        mBottomTaskView.setVisibility(VISIBLE);
+    }
+
+    void setFakeTaskViewFillColor(@ColorInt int colorResId) {
+        mFullTaskView.setBackgroundColor(colorResId);
+        mTopTaskView.setCardBackgroundColor(colorResId);
+        mBottomTaskView.setCardBackgroundColor(colorResId);
+    }
+
+    @Override
+    public void setClipToOutline(boolean clipToOutline) {
+        mFullTaskView.setClipToOutline(clipToOutline);
+    }
+
+    @Override
+    public void setOutlineProvider(ViewOutlineProvider provider) {
+        mTaskViewOutlineProvider = provider;
+        mFullTaskView.setOutlineProvider(mTaskViewOutlineProvider);
+    }
+}
diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
index ff1743f..9d60e1b 100644
--- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
@@ -17,6 +17,7 @@
 
 import static com.android.launcher3.anim.Interpolators.ACCEL;
 
+import android.animation.Animator;
 import android.animation.AnimatorSet;
 import android.annotation.TargetApi;
 import android.graphics.PointF;
@@ -29,6 +30,8 @@
 import com.android.quickstep.interaction.EdgeBackGestureHandler.BackGestureResult;
 import com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult;
 
+import java.util.ArrayList;
+
 /** A {@link TutorialController} for the Overview tutorial. */
 @TargetApi(Build.VERSION_CODES.R)
 final class OverviewGestureTutorialController extends SwipeUpGestureTutorialController {
@@ -123,10 +126,24 @@
     }
 
     public void animateTaskViewToOverview() {
-        PendingAnimation anim = new PendingAnimation(300);
+        PendingAnimation anim = new PendingAnimation(TASK_VIEW_END_ANIMATION_DURATION_MILLIS);
         anim.setFloat(mTaskViewSwipeUpAnimation
                 .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCEL);
-        AnimatorSet animset = anim.buildAnim();
+
+        ArrayList<Animator> animators = new ArrayList<>();
+
+        if (mTutorialFragment.isLargeScreen()) {
+            Animator multiRowAnimation = mFakePreviousTaskView.createAnimationToMultiRowLayout();
+
+            if (multiRowAnimation != null) {
+                multiRowAnimation.setDuration(TASK_VIEW_END_ANIMATION_DURATION_MILLIS);
+                animators.add(multiRowAnimation);
+            }
+        }
+        animators.add(anim.buildAnim());
+
+        AnimatorSet animset = new AnimatorSet();
+        animset.playTogether(animators);
         animset.start();
         mRunningWindowAnim = SwipeUpAnimationLogic.RunningWindowAnim.wrap(animset);
     }
diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
index 30430ff..0c7b35b 100644
--- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
@@ -63,6 +63,7 @@
 
     private static final int FAKE_PREVIOUS_TASK_MARGIN = Utilities.dpToPx(12);
 
+    protected static final long TASK_VIEW_END_ANIMATION_DURATION_MILLIS = 300;
     private static final long HOME_SWIPE_ANIMATION_DURATION_MILLIS = 625;
     private static final long OVERVIEW_SWIPE_ANIMATION_DURATION_MILLIS = 1000;
 
@@ -89,6 +90,7 @@
             mFakeTaskView.setAlpha(1);
             mFakePreviousTaskView.setVisibility(View.INVISIBLE);
             mFakePreviousTaskView.setAlpha(1);
+            mFakePreviousTaskView.setToSingleRowLayout(false);
             mShowTasks = false;
             mShowPreviousTasks = false;
             mRunningWindowAnim = null;
@@ -146,7 +148,8 @@
             anim.addListener(new AnimatorListenerAdapter() {
                 @Override
                 public void onAnimationEnd(Animator animation, boolean isReverse) {
-                    PendingAnimation fadeAnim = new PendingAnimation(300);
+                    PendingAnimation fadeAnim =
+                            new PendingAnimation(TASK_VIEW_END_ANIMATION_DURATION_MILLIS);
                     if (reset) {
                         fadeAnim.setFloat(mTaskViewSwipeUpAnimation
                                 .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCEL);
@@ -159,6 +162,23 @@
                         fadeAnim.addListener(AnimatorListeners.forSuccessCallback(onEndRunnable));
                     }
                     AnimatorSet animset = fadeAnim.buildAnim();
+
+                    if (reset && mTutorialFragment.isLargeScreen()) {
+                        animset.addListener(new AnimatorListenerAdapter() {
+                            @Override
+                            public void onAnimationStart(Animator animation) {
+                                super.onAnimationStart(animation);
+                                Animator multiRowAnimation =
+                                        mFakePreviousTaskView.createAnimationToMultiRowLayout();
+
+                                if (multiRowAnimation != null) {
+                                    multiRowAnimation.setDuration(
+                                            TASK_VIEW_END_ANIMATION_DURATION_MILLIS).start();
+                                }
+                            }
+                        });
+                    }
+
                     animset.setStartDelay(100);
                     animset.start();
                     mRunningWindowAnim = RunningWindowAnim.wrap(animset);
@@ -301,7 +321,7 @@
                 public RectF getWindowTargetRect() {
                     int fakeHomeIconSizePx = Utilities.dpToPx(60);
                     int fakeHomeIconLeft = mFakeHotseatView.getLeft();
-                    int fakeHomeIconTop = mDp.heightPx - Utilities.dpToPx(216);
+                    int fakeHomeIconTop = mFakeHotseatView.getTop();
                     return new RectF(fakeHomeIconLeft, fakeHomeIconTop,
                             fakeHomeIconLeft + fakeHomeIconSizePx,
                             fakeHomeIconTop + fakeHomeIconSizePx);
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
index ef62fd6..94fb556 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
@@ -24,6 +24,7 @@
 import android.animation.AnimatorSet;
 import android.animation.ObjectAnimator;
 import android.animation.ValueAnimator;
+import android.annotation.ColorRes;
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.graphics.drawable.AnimatedVectorDrawable;
@@ -87,7 +88,7 @@
     final ImageView mFakeHotseatView;
     final ClipIconView mFakeIconView;
     final FrameLayout mFakeTaskView;
-    final View mFakePreviousTaskView;
+    final AnimatedTaskView mFakePreviousTaskView;
     final View mRippleView;
     final RippleDrawable mRippleDrawable;
     final Button mActionButton;
@@ -177,9 +178,9 @@
         return View.NO_ID;
     }
 
-    @DrawableRes
-    protected int getMockPreviousAppTaskThumbnailResId() {
-        return R.drawable.default_sandbox_app_previous_task_thumbnail;
+    @ColorRes
+    protected int getMockPreviousAppTaskThumbnailColorResId() {
+        return R.color.gesture_tutorial_fake_previous_task_view_color;
     }
 
     @DrawableRes
@@ -442,8 +443,8 @@
             updateFakeAppTaskViewLayout(getMockAppTaskLayoutResId());
             mFakeTaskView.animate().alpha(1).setListener(
                     AnimatorListeners.forSuccessCallback(() -> mFakeTaskView.animate().cancel()));
-            mFakePreviousTaskView.setBackground(AppCompatResources.getDrawable(
-                    mContext, getMockPreviousAppTaskThumbnailResId()));
+            mFakePreviousTaskView.setFakeTaskViewFillColor(mContext.getResources().getColor(
+                    getMockPreviousAppTaskThumbnailColorResId()));
             mFakeIconView.setBackground(AppCompatResources.getDrawable(
                     mContext, getMockAppIconResId()));
         }
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java
index 1d78c6b..89be1a6 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java
@@ -20,6 +20,7 @@
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
+import android.content.pm.ActivityInfo;
 import android.graphics.Insets;
 import android.graphics.drawable.Animatable2;
 import android.graphics.drawable.AnimatedVectorDrawable;
@@ -40,6 +41,7 @@
 import androidx.fragment.app.Fragment;
 import androidx.fragment.app.FragmentActivity;
 
+import com.android.launcher3.InvariantDeviceProfile;
 import com.android.launcher3.R;
 import com.android.quickstep.interaction.TutorialController.TutorialType;
 
@@ -63,6 +65,8 @@
 
     private boolean mFragmentStopped = false;
 
+    private boolean mIsLargeScreen;
+
     public static TutorialFragment newInstance(TutorialType tutorialType) {
         TutorialFragment fragment = getFragmentForTutorialType(tutorialType);
         if (fragment == null) {
@@ -130,6 +134,21 @@
         mTutorialType = (TutorialType) args.getSerializable(KEY_TUTORIAL_TYPE);
         mEdgeBackGestureHandler = new EdgeBackGestureHandler(getContext());
         mNavBarGestureHandler = new NavBarGestureHandler(getContext());
+
+        mIsLargeScreen = InvariantDeviceProfile.INSTANCE.get(getContext())
+                .getDeviceProfile(getContext()).isTablet;
+
+        if (mIsLargeScreen) {
+            ((Activity) getContext()).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER);
+        } else {
+            // Temporary until UI mocks for landscape mode for phones are created.
+            ((Activity) getContext()).setRequestedOrientation(
+                    ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+        }
+    }
+
+    public boolean isLargeScreen() {
+        return mIsLargeScreen;
     }
 
     @Override
diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
index a4db596..9c6fd3d 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -218,8 +218,8 @@
 
     private boolean updateHandler() {
         mRecentsActivityRotation = inferRecentsActivityRotation(mDisplayRotation);
-        if (mRecentsActivityRotation == mTouchRotation
-                || (canRecentsActivityRotate() && (mFlags & FLAG_SWIPE_UP_NOT_RUNNING) != 0)) {
+        if (mRecentsActivityRotation == mTouchRotation || (isRecentsActivityRotationAllowed()
+                && (mFlags & FLAG_SWIPE_UP_NOT_RUNNING) != 0)) {
             mOrientationHandler = PagedOrientationHandler.PORTRAIT;
         } else if (mTouchRotation == ROTATION_90) {
             mOrientationHandler = PagedOrientationHandler.LANDSCAPE;
@@ -253,7 +253,7 @@
     private boolean setFlag(int mask, boolean enabled) {
         boolean wasRotationEnabled = !TestProtocol.sDisableSensorRotation
                 && (mFlags & VALUE_ROTATION_WATCHER_ENABLED) == VALUE_ROTATION_WATCHER_ENABLED
-                && !canRecentsActivityRotate();
+                && !isRecentsActivityRotationAllowed();
         if (enabled) {
             mFlags |= mask;
         } else {
@@ -262,7 +262,7 @@
 
         boolean isRotationEnabled = !TestProtocol.sDisableSensorRotation
                 && (mFlags & VALUE_ROTATION_WATCHER_ENABLED) == VALUE_ROTATION_WATCHER_ENABLED
-                && !canRecentsActivityRotate();
+                && !isRecentsActivityRotationAllowed();
         if (wasRotationEnabled != isRotationEnabled) {
             UI_HELPER_EXECUTOR.execute(() -> {
                 if (isRotationEnabled) {
@@ -376,13 +376,6 @@
     }
 
     /**
-     * Returns true if the activity can rotate, if allowed by system rotation settings
-     */
-    public boolean canRecentsActivityRotate() {
-        return (mFlags & FLAG_SYSTEM_ROTATION_ALLOWED) != 0 && isRecentsActivityRotationAllowed();
-    }
-
-    /**
      * Enables or disables the rotation watcher for listening to rotation callbacks
      */
     public void setRotationWatcherEnabled(boolean isEnabled) {
diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
index e88ebcf..734c844 100644
--- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
+++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java
@@ -17,7 +17,11 @@
 
 import static com.android.launcher3.states.RotationHelper.deltaRotation;
 import static com.android.launcher3.touch.PagedOrientationHandler.MATRIX_POST_TRANSLATE;
-import static com.android.launcher3.util.SplitConfigurationOptions.*;
+import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
+import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
+import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED;
+import static com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
+import static com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds;
 import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation;
 import static com.android.quickstep.util.RecentsOrientedState.preDisplayRotation;
 import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN;
@@ -26,7 +30,6 @@
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.Matrix;
-import android.graphics.Point;
 import android.graphics.PointF;
 import android.graphics.Rect;
 import android.graphics.RectF;
@@ -56,8 +59,6 @@
 
     private final Rect mTmpCropRect = new Rect();
     private final RectF mTempRectF = new RectF();
-    // Additional offset for split tasks
-    private final Point mSplitOffset = new Point();
     private final float[] mTempPoint = new float[2];
 
     private final Context mContext;
@@ -75,7 +76,6 @@
 
     private final Matrix mMatrix = new Matrix();
     private final Matrix mMatrixTmp = new Matrix();
-    private final Point mRunningTargetWindowPosition = new Point();
 
     // Thumbnail view properties
     private final Rect mThumbnailPosition = new Rect();
@@ -159,8 +159,6 @@
      */
     public void setPreview(RemoteAnimationTargetCompat runningTarget) {
         setPreviewBounds(runningTarget.screenSpaceBounds, runningTarget.contentInsets);
-        mRunningTargetWindowPosition.set(runningTarget.screenSpaceBounds.left,
-                runningTarget.screenSpaceBounds.top);
     }
 
     /**
@@ -261,9 +259,6 @@
                 mOrientationState.getRecentsActivityRotation(),
                 mOrientationState.getDisplayRotation()),
                 mDp.widthPx, mDp.heightPx, matrix);
-        matrix.postTranslate(-mRunningTargetWindowPosition.x, -mRunningTargetWindowPosition.y);
-        // Move lower/right split window into correct position
-        matrix.postTranslate(mSplitOffset.x, mSplitOffset.y);
     }
 
     /**
@@ -280,11 +275,6 @@
             getFullScreenScale();
             mThumbnailData.rotation = mOrientationState.getDisplayRotation();
 
-            if (mStagedSplitBounds != null) {
-                mOrientationState.getOrientationHandler().setLeashSplitOffset(mSplitOffset, mDp,
-                        mStagedSplitBounds, mStagePosition);
-            }
-
             // mIsRecentsRtl is the inverse of TaskView RTL.
             boolean isRtlEnabled = !mIsRecentsRtl;
             mPositionHelper.updateThumbnailMatrix(
@@ -293,7 +283,7 @@
                     mDp, mOrientationState.getRecentsActivityRotation(), isRtlEnabled);
             mPositionHelper.getMatrix().invert(mInversePositionMatrix);
             if (DEBUG) {
-                Log.d(TAG, " taskRect: " + mTaskRect + " splitOffset: " + mSplitOffset);
+                Log.d(TAG, " taskRect: " + mTaskRect);
             }
         }
 
@@ -344,7 +334,6 @@
                 + " recentsViewScale: " + recentsViewScale.value
                 + " crop: " + mTmpCropRect
                 + " radius: " + getCurrentCornerRadius()
-                + " translate: " + mSplitOffset
                 + " taskW: " + taskWidth + " H: " + taskHeight
                 + " taskRect: " + mTaskRect
                 + " taskPrimaryT: " + taskPrimaryTranslation.value
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index ddb1fca..5ca5c94 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -29,18 +29,14 @@
 import android.util.AttributeSet;
 import android.view.MotionEvent;
 import android.view.Surface;
-import android.widget.FrameLayout;
 
 import com.android.launcher3.BaseQuickstepLauncher;
 import com.android.launcher3.LauncherState;
 import com.android.launcher3.statehandlers.DepthController;
 import com.android.launcher3.statemanager.StateManager.StateListener;
-import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
 import com.android.launcher3.util.SplitConfigurationOptions;
 import com.android.quickstep.LauncherActivityInterface;
 import com.android.quickstep.util.SplitSelectStateController;
-import com.android.systemui.plugins.PluginListener;
-import com.android.systemui.plugins.RecentsExtraCard;
 
 /**
  * {@link RecentsView} used in Launcher activity
@@ -49,25 +45,6 @@
 public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher, LauncherState>
         implements StateListener<LauncherState> {
 
-    private RecentsExtraCard mRecentsExtraCardPlugin;
-    private RecentsExtraViewContainer mRecentsExtraViewContainer;
-    private PluginListener<RecentsExtraCard> mRecentsExtraCardPluginListener =
-            new PluginListener<RecentsExtraCard>() {
-        @Override
-        public void onPluginConnected(RecentsExtraCard recentsExtraCard, Context context) {
-            createRecentsExtraCard();
-            mRecentsExtraCardPlugin = recentsExtraCard;
-            mRecentsExtraCardPlugin.setupView(context, mRecentsExtraViewContainer, mActivity);
-        }
-
-        @Override
-        public void onPluginDisconnected(RecentsExtraCard plugin) {
-            removeView(mRecentsExtraViewContainer);
-            mRecentsExtraCardPlugin = null;
-            mRecentsExtraViewContainer = null;
-        }
-    };
-
     public LauncherRecentsView(Context context) {
         this(context, null);
     }
@@ -148,73 +125,6 @@
     }
 
     @Override
-    protected void onAttachedToWindow() {
-        super.onAttachedToWindow();
-        PluginManagerWrapper.INSTANCE.get(getContext()).addPluginListener(
-                mRecentsExtraCardPluginListener, RecentsExtraCard.class);
-    }
-
-    @Override
-    protected void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-        PluginManagerWrapper.INSTANCE.get(getContext()).removePluginListener(
-                mRecentsExtraCardPluginListener);
-    }
-
-    @Override
-    protected int computeMinScroll() {
-        if (canComputeScrollX() && !mIsRtl) {
-            return computeScrollX();
-        }
-        return super.computeMinScroll();
-    }
-
-    @Override
-    protected int computeMaxScroll() {
-        if (canComputeScrollX() && mIsRtl) {
-            return computeScrollX();
-        }
-        return super.computeMaxScroll();
-    }
-
-    private boolean canComputeScrollX() {
-        return mRecentsExtraCardPlugin != null && getTaskViewCount() > 0
-                && !mDisallowScrollToClearAll;
-    }
-
-    private int computeScrollX() {
-        int scrollIndex = getTaskViewStartIndex() - 1;
-        while (scrollIndex >= 0 && getChildAt(scrollIndex) instanceof RecentsExtraViewContainer
-                && ((RecentsExtraViewContainer) getChildAt(scrollIndex)).isScrollable()) {
-            scrollIndex--;
-        }
-        return getScrollForPage(scrollIndex + 1);
-    }
-
-    private void createRecentsExtraCard() {
-        mRecentsExtraViewContainer = new RecentsExtraViewContainer(getContext());
-        FrameLayout.LayoutParams helpCardParams =
-                new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
-                        FrameLayout.LayoutParams.MATCH_PARENT);
-        mRecentsExtraViewContainer.setLayoutParams(helpCardParams);
-        mRecentsExtraViewContainer.setScrollable(true);
-        addView(mRecentsExtraViewContainer, 0);
-    }
-
-    @Override
-    public boolean hasRecentsExtraCard() {
-        return mRecentsExtraViewContainer != null;
-    }
-
-    @Override
-    public void setContentAlpha(float alpha) {
-        super.setContentAlpha(alpha);
-        if (mRecentsExtraViewContainer != null) {
-            mRecentsExtraViewContainer.setAlpha(alpha);
-        }
-    }
-
-    @Override
     protected DepthController getDepthController() {
         return mActivity.getDepthController();
     }
diff --git a/quickstep/src/com/android/quickstep/views/RecentsExtraViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsExtraViewContainer.java
deleted file mode 100644
index 16bc3bc..0000000
--- a/quickstep/src/com/android/quickstep/views/RecentsExtraViewContainer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.quickstep.views;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.widget.FrameLayout;
-
-/**
- * Empty view to house recents overview extra card
- */
-public class RecentsExtraViewContainer extends FrameLayout {
-
-    private boolean mScrollable = false;
-
-    public RecentsExtraViewContainer(Context context) {
-        super(context);
-    }
-
-    public RecentsExtraViewContainer(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public RecentsExtraViewContainer(Context context, AttributeSet attrs, int defStyleAttr) {
-        super(context, attrs, defStyleAttr);
-    }
-
-    /**
-     * Determine whether the view should be scrolled to in the recents overview, similar to the
-     * taskviews.
-     * @return true if viewed should be scrolled to, false if not
-     */
-    public boolean isScrollable() {
-        return mScrollable;
-    }
-
-    public void setScrollable(boolean scrollable) {
-        this.mScrollable = scrollable;
-    }
-}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 1c1dc9c..e1a3895 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -103,6 +103,7 @@
 import android.view.animation.Interpolator;
 import android.widget.ListView;
 import android.widget.OverScroller;
+import android.widget.Toast;
 
 import androidx.annotation.Nullable;
 import androidx.annotation.UiThread;
@@ -116,7 +117,6 @@
 import com.android.launcher3.PagedView;
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
-import com.android.launcher3.anim.AnimationSuccessListener;
 import com.android.launcher3.anim.AnimatorListeners;
 import com.android.launcher3.anim.AnimatorPlaybackController;
 import com.android.launcher3.anim.PendingAnimation;
@@ -591,6 +591,8 @@
     private TaskView mSplitHiddenTaskView;
     private TaskView mSecondSplitHiddenTaskView;
     private SplitConfigurationOptions.StagedSplitBounds mSplitBoundsConfig;
+    private final Toast mSplitToast = Toast.makeText(getContext(),
+            R.string.toast_split_select_app, Toast.LENGTH_SHORT);
 
     /**
      * Keeps track of the index of the TaskView that split screen was initialized with so we know
@@ -609,8 +611,6 @@
      */
     private TaskView mMovingTaskView;
 
-    // Keeps track of the index where the first TaskView should be
-    private int mTaskViewStartIndex = 0;
     private OverviewActionsView mActionsView;
 
     private MultiWindowModeChangedListener mMultiWindowModeChangedListener =
@@ -895,7 +895,6 @@
             taskView.setTaskViewId(-1);
             mActionsView.updateHiddenFlags(HIDDEN_NO_TASKS, getTaskViewCount() == 0);
         }
-        updateTaskStartIndex(child);
     }
 
     @Override
@@ -905,7 +904,6 @@
         // RecentsView is set to RTL in the constructor when system is using LTR. Here we set the
         // child direction back to match system settings.
         child.setLayoutDirection(mIsRtl ? View.LAYOUT_DIRECTION_LTR : View.LAYOUT_DIRECTION_RTL);
-        updateTaskStartIndex(child);
         mActionsView.updateHiddenFlags(HIDDEN_NO_TASKS, false);
         updateEmptyMessage();
     }
@@ -998,18 +996,6 @@
         anim.start();
     }
 
-    private void updateTaskStartIndex(View affectingView) {
-        if (!(affectingView instanceof TaskView) && !(affectingView instanceof ClearAllButton)) {
-            int childCount = getChildCount();
-
-            mTaskViewStartIndex = 0;
-            while (mTaskViewStartIndex < childCount
-                    && !(getChildAt(mTaskViewStartIndex) instanceof TaskView)) {
-                mTaskViewStartIndex++;
-            }
-        }
-    }
-
     public boolean isTaskViewVisible(TaskView tv) {
         if (showAsGrid()) {
             int screenStart = mOrientationHandler.getPrimaryScroll(this);
@@ -1074,8 +1060,7 @@
      * @param taskIndex the index of the task
      */
     public boolean isTaskSnapped(int taskIndex) {
-        return getScrollForPage(taskIndex + mTaskViewStartIndex)
-                == getPagedOrientationHandler().getPrimaryScroll(this);
+        return getScrollForPage(taskIndex) == getPagedOrientationHandler().getPrimaryScroll(this);
     }
 
     public TaskView getTaskViewByTaskId(int taskId) {
@@ -1289,7 +1274,7 @@
             return;
         }
 
-        if (mCurrentPage == mTaskViewStartIndex) {
+        if (mCurrentPage == 0) {
             return;
         }
 
@@ -1301,8 +1286,8 @@
         removeView(focusedTaskView);
         mMovingTaskView = null;
         focusedTaskView.resetPersistentViewTransforms();
-        addView(focusedTaskView, mTaskViewStartIndex);
-        setCurrentPage(mTaskViewStartIndex);
+        addView(focusedTaskView, 0);
+        setCurrentPage(0);
 
         updateGridProperties();
     }
@@ -1320,7 +1305,7 @@
         }
 
         int currentTaskId = -1;
-        TaskView currentTaskView = getTaskViewAtByAbsoluteIndex(mCurrentPage);
+        TaskView currentTaskView = getTaskViewAt(mCurrentPage);
         if (currentTaskView != null) {
             currentTaskId = currentTaskView.getTask().key.id;
         }
@@ -1374,7 +1359,7 @@
         for (int taskViewIndex = requiredTaskViewCount - 1, taskDataIndex = tasks.size() - 1;
                 taskViewIndex >= 0;
                 taskViewIndex--, taskDataIndex--) {
-            final int pageIndex = requiredTaskViewCount - taskViewIndex - 1 + mTaskViewStartIndex;
+            final int pageIndex = requiredTaskViewCount - taskViewIndex - 1;
             final Task task = tasks.get(taskDataIndex);
             final TaskView taskView = (TaskView) getChildAt(pageIndex);
             if (taskView instanceof GroupedTaskView) {
@@ -1415,7 +1400,7 @@
             if (newRunningTaskView == null) {
                 StringBuilder sb = new StringBuilder();
                 for (int i = requiredTaskViewCount - 1; i >= 0; i--) {
-                    final int pageIndex = requiredTaskViewCount - i - 1 + mTaskViewStartIndex;
+                    final int pageIndex = requiredTaskViewCount - i - 1;
                     final TaskView taskView = (TaskView) getChildAt(pageIndex);
                     int taskViewId = taskView.getTaskViewId();
                     sb.append(" taskViewId: " + taskViewId
@@ -1478,7 +1463,7 @@
     }
 
     public int getTaskViewCount() {
-        int taskViewCount = getChildCount() - mTaskViewStartIndex;
+        int taskViewCount = getChildCount();
         if (indexOfChild(mClearAllButton) != -1) {
             taskViewCount--;
         }
@@ -1612,7 +1597,7 @@
         boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0
                 || mOrientationState.getRecentsActivityRotation() != ROTATION_0;
         mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION,
-                !mOrientationState.canRecentsActivityRotate() && isInLandscape);
+                !mOrientationState.isRecentsActivityRotationAllowed() && isInLandscape);
 
         // Update TaskView's DeviceProfile dependent layout.
         updateChildTaskOrientations();
@@ -1893,11 +1878,6 @@
 
     public abstract void startHome();
 
-    /** `true` if there is a +1 space available in overview. */
-    public boolean hasRecentsExtraCard() {
-        return false;
-    }
-
     public void reset() {
         setCurrentTask(-1);
         mIgnoreResetTaskId = -1;
@@ -2004,10 +1984,6 @@
         return tv == null ? -1 : indexOfChild(tv);
     }
 
-    public int getTaskViewStartIndex() {
-        return mTaskViewStartIndex;
-    }
-
     /**
      * Reloads the view if anything in recents changed.
      */
@@ -2044,7 +2020,7 @@
     }
 
     private void animateRecentsRotationInPlace(int newRotation) {
-        if (mOrientationState.canRecentsActivityRotate()) {
+        if (mOrientationState.isRecentsActivityRotationAllowed()) {
             // Let system take care of the rotation
             return;
         }
@@ -2182,7 +2158,7 @@
                         Task.from(new TaskKey(taskInfo), taskInfo, false),
                         Task.from(new TaskKey(secondaryTaskInfo), secondaryTaskInfo, false)
                 };
-                addView(taskView, mTaskViewStartIndex);
+                addView(taskView, 0);
                 // When we create a placeholder task view mSplitBoundsConfig will be null, but with
                 // the actual app running we won't need to show the thumbnail until all the tasks
                 // load later anyways
@@ -2190,7 +2166,7 @@
                         mOrientationState, mSplitBoundsConfig);
             } else {
                 taskView = getTaskViewFromPool(false);
-                addView(taskView, mTaskViewStartIndex);
+                addView(taskView, 0);
                 // The temporary running task is only used for the duration between the start of the
                 // gesture and the task list is loaded and applied
                 mTmpRunningTasks = new Task[]{Task.from(new TaskKey(taskInfo), taskInfo, false)};
@@ -2358,7 +2334,7 @@
         int focusedTaskWidthAndSpacing = 0;
         int snappedTaskRowWidth = 0;
         int snappedPage = getNextPage();
-        TaskView snappedTaskView = getTaskViewAtByAbsoluteIndex(snappedPage);
+        TaskView snappedTaskView = getTaskViewAt(snappedPage);
         TaskView homeTaskView = getHomeTaskView();
         TaskView nextFocusedTaskView = null;
 
@@ -2471,7 +2447,7 @@
         if (snappedTaskView != null) {
             snappedTaskNonGridScrollAdjustment = snappedTaskView.getScrollAdjustment(
                     /*fullscreenEnabled=*/true, /*gridEnabled=*/false);
-            snappedTaskGridTranslationX = gridTranslations[snappedPage - mTaskViewStartIndex];
+            snappedTaskGridTranslationX = gridTranslations[snappedPage];
         }
 
         // Use the accumulated translation of the row containing the last task.
@@ -2679,6 +2655,11 @@
         mFirstFloatingTaskView.setAlpha(1);
         mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
                 mTempRect, mSplitHiddenTaskView, true /*fadeWithThumbnail*/);
+        anim.addEndListener(success -> {
+            if (success) {
+                mSplitToast.show();
+            }
+        });
     }
 
     /**
@@ -3022,7 +3003,7 @@
                             // Get the id of the task view we will snap to based on the current
                             // page's relative position as the order of indices change over time due
                             // to dismissals.
-                            TaskView snappedTaskView = getTaskViewAtByAbsoluteIndex(mCurrentPage);
+                            TaskView snappedTaskView = getTaskViewAt(mCurrentPage);
                             if (snappedTaskView != null) {
                                 if (snappedTaskView.getTaskViewId() == mFocusedTaskViewId) {
                                     if (finalNextFocusedTaskView != null) {
@@ -3221,10 +3202,7 @@
 
             if (isTaskViewVisible(topTask)) {
                 TaskView bottomTask = getTaskViewFromTaskViewId(bottomRowIdArray.get(i));
-                lastVisibleIndex = Math.max(
-                        indexOfChild(topTask) - mTaskViewStartIndex,
-                        indexOfChild(bottomTask) - mTaskViewStartIndex
-                );
+                lastVisibleIndex = Math.max(indexOfChild(topTask), indexOfChild(bottomTask));
             } else if (lastVisibleIndex < Integer.MAX_VALUE) {
                 break;
             }
@@ -3497,22 +3475,22 @@
 
     @Nullable
     public TaskView getNextTaskView() {
-        return getTaskViewAtByAbsoluteIndex(getRunningTaskIndex() + 1);
+        return getTaskViewAt(getRunningTaskIndex() + 1);
     }
 
     @Nullable
     public TaskView getCurrentPageTaskView() {
-        return getTaskViewAtByAbsoluteIndex(getCurrentPage());
+        return getTaskViewAt(getCurrentPage());
     }
 
     @Nullable
     public TaskView getNextPageTaskView() {
-        return getTaskViewAtByAbsoluteIndex(getNextPage());
+        return getTaskViewAt(getNextPage());
     }
 
     @Nullable
     public TaskView getTaskViewNearestToCenterOfScreen() {
-        return getTaskViewAtByAbsoluteIndex(getPageNearestToCenterOfScreen());
+        return getTaskViewAt(getPageNearestToCenterOfScreen());
     }
 
     /**
@@ -3520,16 +3498,8 @@
      */
     @Nullable
     public TaskView getTaskViewAt(int index) {
-        return getTaskViewAtByAbsoluteIndex(index + mTaskViewStartIndex);
-    }
-
-    @Nullable
-    private TaskView getTaskViewAtByAbsoluteIndex(int index) {
-        if (index < getChildCount() && index >= 0) {
-            View child = getChildAt(index);
-            return child instanceof TaskView ? (TaskView) child : null;
-        }
-        return null;
+        View child = getChildAt(index);
+        return child instanceof TaskView ? (TaskView) child : null;
     }
 
     public void setOnEmptyMessageUpdatedListener(OnEmptyMessageUpdatedListener listener) {
@@ -3810,6 +3780,7 @@
     }
 
     public void confirmSplitSelect(TaskView taskView) {
+        mSplitToast.cancel();
         RectF secondTaskStartingBounds = new RectF();
         Rect secondTaskEndingBounds = new Rect();
         // TODO(194414938) starting bounds seem slightly off, investigate
@@ -3851,6 +3822,7 @@
         splitController.resetState();
         int duration = mActivity.getStateManager().getState().getTransitionDuration(getContext());
         PendingAnimation pendingAnim = new PendingAnimation(duration);
+        mSplitToast.cancel();
         if (!animate) {
             resetFromSplitSelectionState();
             return pendingAnim;
@@ -3928,9 +3900,9 @@
             pendingAnim.addOnFrameCallback(this::updateCurveProperties);
         }
 
-        pendingAnim.addListener(new AnimationSuccessListener() {
+        pendingAnim.addListener(new AnimatorListenerAdapter() {
             @Override
-            public void onAnimationSuccess(Animator animator) {
+            public void onAnimationEnd(Animator animation) {
                 // TODO(b/186800707) Figure out how to undo for grid view
                 //  Need to handle cases where dismissed task is
                 //  * Top Row
@@ -4385,7 +4357,7 @@
             } else {
                 TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null;
                 return getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView)
-                        : mTaskViewStartIndex);
+                        : 0);
             }
         }
         return super.computeMinScroll();
@@ -4397,7 +4369,7 @@
             if (mIsRtl) {
                 TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null;
                 return getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView)
-                        : mTaskViewStartIndex);
+                        : 0);
             } else {
                 // If we aren't showing the clear all button, use the leftmost task as the min
                 // scroll.
@@ -4449,7 +4421,7 @@
         for (int i = 0; i < taskCount; i++) {
             TaskView taskView = getTaskViewAt(i);
             float scrollDiff = taskView.getScrollAdjustment(showAsFullscreen, showAsGrid);
-            int pageScroll = newPageScrolls[i + mTaskViewStartIndex] + (int) scrollDiff;
+            int pageScroll = newPageScrolls[i] + (int) scrollDiff;
             if ((mIsRtl && pageScroll < clearAllScroll + clearAllWidth)
                     || (!mIsRtl && pageScroll > clearAllScroll - clearAllWidth)) {
                 pageScroll = clearAllScroll + (mIsRtl ? clearAllWidth : -clearAllWidth);
@@ -4478,7 +4450,7 @@
 
     @Override
     protected int getChildVisibleSize(int index) {
-        final TaskView taskView = getTaskViewAtByAbsoluteIndex(index);
+        final TaskView taskView = getTaskViewAt(index);
         if (taskView == null) {
             return super.getChildVisibleSize(index);
         }
@@ -4521,7 +4493,7 @@
      * according to {@link #mGridProgress}.
      */
     public float getGridTranslationSecondary(int pageIndex) {
-        TaskView taskView = getTaskViewAtByAbsoluteIndex(pageIndex);
+        TaskView taskView = getTaskViewAt(pageIndex);
         if (taskView == null) {
             return 0;
         }
@@ -4562,8 +4534,8 @@
     private void updateEnabledOverlays() {
         int overlayEnabledPage = mOverlayEnabled ? getNextPage() : -1;
         int taskCount = getTaskViewCount();
-        for (int i = mTaskViewStartIndex; i < mTaskViewStartIndex + taskCount; i++) {
-            getTaskViewAtByAbsoluteIndex(i).setOverlayEnabled(i == overlayEnabledPage);
+        for (int i = 0; i < taskCount; i++) {
+            getTaskViewAt(i).setOverlayEnabled(i == overlayEnabledPage);
         }
     }
 
@@ -4666,7 +4638,7 @@
             getCurrentPageTaskView().setModalness(modalness);
         }
         // Only show actions view when it's modal for in-place landscape mode.
-        boolean inPlaceLandscape = !mOrientationState.canRecentsActivityRotate()
+        boolean inPlaceLandscape = !mOrientationState.isRecentsActivityRotationAllowed()
                 && mOrientationState.getTouchRotation() != ROTATION_0;
         mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION, modalness < 1 && inPlaceLandscape);
     }
diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
index 28044e4..a9db400 100644
--- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
@@ -47,20 +47,17 @@
 import com.android.launcher3.BaseActivity;
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.Utilities;
-import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
 import com.android.launcher3.util.MainThreadInitializedObject;
 import com.android.launcher3.util.SystemUiController;
 import com.android.quickstep.TaskOverlayFactory.TaskOverlay;
 import com.android.quickstep.views.TaskView.FullscreenDrawParams;
-import com.android.systemui.plugins.OverviewScreenshotActions;
-import com.android.systemui.plugins.PluginListener;
 import com.android.systemui.shared.recents.model.Task;
 import com.android.systemui.shared.recents.model.ThumbnailData;
 
 /**
  * A task in the Recents view.
  */
-public class TaskThumbnailView extends View implements PluginListener<OverviewScreenshotActions> {
+public class TaskThumbnailView extends View {
     private static final MainThreadInitializedObject<FullscreenDrawParams> TEMP_PARAMS =
             new MainThreadInitializedObject<>(FullscreenDrawParams::new);
 
@@ -97,7 +94,6 @@
     private float mDimAlpha = 0f;
 
     private boolean mOverlayEnabled;
-    private OverviewScreenshotActions mOverviewScreenshotActionsPlugin;
 
     public TaskThumbnailView(Context context) {
         this(context, null);
@@ -171,9 +167,6 @@
             mPaint.setShader(null);
             getTaskOverlay().reset();
         }
-        if (mOverviewScreenshotActionsPlugin != null) {
-            mOverviewScreenshotActionsPlugin.setupActions(getTaskView(), getThumbnail(), mActivity);
-        }
         updateThumbnailPaintFilter();
     }
 
@@ -265,33 +258,6 @@
         canvas.restore();
     }
 
-    @Override
-    public void onPluginConnected(OverviewScreenshotActions overviewScreenshotActions,
-            Context context) {
-        mOverviewScreenshotActionsPlugin = overviewScreenshotActions;
-        mOverviewScreenshotActionsPlugin.setupActions(getTaskView(), getThumbnail(), mActivity);
-    }
-
-    @Override
-    public void onPluginDisconnected(OverviewScreenshotActions plugin) {
-        if (mOverviewScreenshotActionsPlugin != null) {
-            mOverviewScreenshotActionsPlugin = null;
-        }
-    }
-
-    @Override
-    protected void onAttachedToWindow() {
-        super.onAttachedToWindow();
-        PluginManagerWrapper.INSTANCE.get(getContext())
-            .addPluginListener(this, OverviewScreenshotActions.class);
-    }
-
-    @Override
-    protected void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-        PluginManagerWrapper.INSTANCE.get(getContext()).removePluginListener(this);
-    }
-
     public PreviewPositionHelper getPreviewPositionHelper() {
         return mPreviewPositionHelper;
     }
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 95ff0ca..af5c5e5 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -96,7 +96,7 @@
     <string name="folder_name_format_exact" msgid="8626242716117004803">"Carpeta: <xliff:g id="NAME">%1$s</xliff:g> (<xliff:g id="SIZE">%2$d</xliff:g> elementos)"</string>
     <string name="folder_name_format_overflow" msgid="4270108890534995199">"Carpeta: <xliff:g id="NAME">%1$s</xliff:g> (<xliff:g id="SIZE">%2$d</xliff:g> o más elementos)"</string>
     <string name="wallpaper_button_text" msgid="8404103075899945851">"Fondos de pantalla"</string>
-    <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Estilo y fondo de pantalla"</string>
+    <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Fondo de pantalla y estilo"</string>
     <string name="settings_button_text" msgid="8873672322605444408">"Ajustes de la pantalla de inicio"</string>
     <string name="msg_disabled_by_admin" msgid="6898038085516271325">"Inhabilitado por el administrador"</string>
     <string name="allow_rotation_title" msgid="7728578836261442095">"Permitir rotación de la pantalla de inicio"</string>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index 705eaf4..956bc8e 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -41,7 +41,7 @@
     <string name="widgets_and_shortcuts_count" msgid="7209136747878365116">"<xliff:g id="WIDGETS_COUNT">%1$s</xliff:g>, <xliff:g id="SHORTCUTS_COUNT">%2$s</xliff:g>"</string>
     <string name="widget_button_text" msgid="2880537293434387943">"విడ్జెట్‌లు"</string>
     <string name="widgets_full_sheet_search_bar_hint" msgid="8484659090860596457">"సెర్చ్ చేయండి"</string>
-    <string name="widgets_full_sheet_cancel_button_description" msgid="5766167035728653605">"సెర్చ్ బాక్స్ నుండి టెక్స్ట్‌ను క్లియర్ చేయి"</string>
+    <string name="widgets_full_sheet_cancel_button_description" msgid="5766167035728653605">"సెర్చ్ బాక్స్ నుండి టెక్స్ట్‌ను క్లియర్ చేయండి"</string>
     <string name="no_widgets_available" msgid="4337693382501046170">"విడ్జెట్‌లు, షార్ట్‌కట్‌లు అందుబాటులో లేవు"</string>
     <string name="no_search_results" msgid="3787956167293097509">"విడ్జెట్‌లు లేదా షార్ట్‌కట్‌లు కనుగొనబడలేదు"</string>
     <string name="widgets_full_sheet_personal_tab" msgid="2743540105607120182">"వ్యక్తిగత గ్యాడ్జెట్స్"</string>
@@ -52,10 +52,10 @@
     <string name="reconfigurable_widget_education_tip" msgid="6336962690888067057">"విడ్జెట్ సెట్టింగ్‌లను మార్చడానికి ట్యాప్ చేయండి"</string>
     <string name="widget_education_close_button" msgid="8676165703104836580">"అర్థమైంది"</string>
     <string name="widget_reconfigure_button_content_description" msgid="8811472721881205250">"విడ్జెట్ సెట్టింగ్‌లను మార్చండి"</string>
-    <string name="all_apps_search_bar_hint" msgid="1390553134053255246">"అప్లికేషన్‌లను వెతకండి"</string>
+    <string name="all_apps_search_bar_hint" msgid="1390553134053255246">"యాప్‌ల కోసం సెర్చ్ చేయండి"</string>
     <string name="all_apps_loading_message" msgid="5813968043155271636">"అప్లికేషన్‌లను లోడ్ చేస్తోంది…"</string>
     <string name="all_apps_no_search_results" msgid="3200346862396363786">"\"<xliff:g id="QUERY">%1$s</xliff:g>\"కి సరిపోలే అప్లికేషన్‌లేవీ కనుగొనబడలేదు"</string>
-    <string name="all_apps_search_market_message" msgid="1366263386197059176">"మరిన్ని యాప్‌ల కోసం వెతుకు"</string>
+    <string name="all_apps_search_market_message" msgid="1366263386197059176">"మరిన్ని యాప్‌ల కోసం సెర్చ్ చేయండి"</string>
     <string name="label_application" msgid="8531721983832654978">"యాప్"</string>
     <string name="notifications_header" msgid="1404149926117359025">"నోటిఫికేషన్‌లు"</string>
     <string name="long_press_shortcut_to_add" msgid="5405328730817637737">"షార్ట్‌కట్‌ను తరలించడానికి తాకి &amp; నొక్కి ఉంచు."</string>
@@ -114,7 +114,7 @@
     <string name="abandoned_clean_this" msgid="7610119707847920412">"తీసివేయి"</string>
     <string name="abandoned_search" msgid="891119232568284442">"సెర్చ్"</string>
     <string name="abandoned_promises_title" msgid="7096178467971716750">"ఈ యాప్ ఇన్‌స్టాల్ చేయబడలేదు"</string>
-    <string name="abandoned_promise_explanation" msgid="3990027586878167529">"ఈ చిహ్నం యొక్క యాప్ ఇన్‌స్టాల్ చేయబడలేదు. మీరు దీన్ని తీసివేయవచ్చు లేదా ఆ యాప్ కోసం శోధించి దాన్ని మాన్యువల్‌గా ఇన్‌స్టాల్ చేయవచ్చు."</string>
+    <string name="abandoned_promise_explanation" msgid="3990027586878167529">"ఈ ఐకాన్‌కు చెందిన యాప్ ఇన్‌స్టాల్ చేయలేదు. మీరు దీన్ని తీసివేయవచ్చు లేదా ఆ యాప్ కోసం సెర్చ్ చేసి, దాన్ని మాన్యువల్‌గా ఇన్‌స్టాల్ చేయవచ్చు."</string>
     <string name="app_installing_title" msgid="5864044122733792085">"<xliff:g id="NAME">%1$s</xliff:g>‌ను ఇన్‌స్టాల్ చేయడం, <xliff:g id="PROGRESS">%2$s</xliff:g> పూర్తయింది"</string>
     <string name="app_downloading_title" msgid="8336702962104482644">"<xliff:g id="NAME">%1$s</xliff:g> డౌన్‌లోడ్ అవుతోంది, <xliff:g id="PROGRESS">%2$s</xliff:g> పూర్తయింది"</string>
     <string name="app_waiting_download_title" msgid="7053938513995617849">"<xliff:g id="NAME">%1$s</xliff:g> ఇన్‌స్టాల్ కావడానికి వేచి ఉంది"</string>
diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml
index 55cedf4..7bbdbd1 100644
--- a/res/values-v31/colors.xml
+++ b/res/values-v31/colors.xml
@@ -40,7 +40,7 @@
 
     <color name="wallpaper_popup_scrim">@android:color/system_neutral1_900</color>
 
-    <color name="folder_dot_color">@android:color/system_accent2_50</color>
+    <color name="folder_dot_color">@android:color/system_accent3_100</color>
     <color name="folder_pagination_color_light">@android:color/system_accent1_600</color>
     <color name="folder_pagination_color_dark">@android:color/system_accent2_100</color>
 
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 720d736..9c20e1f 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -193,6 +193,8 @@
 
         <attr name="borderSpacingDps" format="float" />
 
+        <attr name="allAppsCellSpacingDps" format="float" />
+
         <attr name="iconImageSize" format="float" />
         <!-- landscapeIconSize defaults to iconImageSize, if not specified -->
         <attr name="landscapeIconSize" format="float" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 323c5ca..f315725 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -198,8 +198,11 @@
     <!-- Error text that lets a user know that the widget can't load. -->
     <string name="gadget_error_text">Can\'t load widget</string>
 
+    <!-- Button text. This button lets a user change a widget's settings. -->
+    <string name="gadget_setup_text">Widget settings</string>
+
     <!-- Instructional text to encourage a user to finish setting up the widget. -->
-    <string name="gadget_setup_text">Tap to finish setup</string>
+    <string name="gadget_complete_setup_text">Tap to finish setup</string>
 
     <!-- Text to inform the user that they can't uninstall a system application -->
     <string name="uninstall_system_app_text">This is a system app and can\'t be uninstalled.</string>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index c7ae373..5bd3e14 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -168,11 +168,13 @@
     public int qsbBottomMarginPx;
 
     // All apps
+    public int allAppsCellSpacingPx;
     public int allAppsOpenVerticalTranslate;
     public int allAppsCellHeightPx;
     public int allAppsCellWidthPx;
     public int allAppsIconSizePx;
     public int allAppsIconDrawablePaddingPx;
+    public int allAppsLeftRightPadding;
     public final int numShownAllAppsColumns;
     public float allAppsIconTextSizePx;
 
@@ -283,6 +285,7 @@
         folderContentPaddingTop = res.getDimensionPixelSize(R.dimen.folder_content_padding_top);
 
         setCellLayoutBorderSpacing(pxFromDp(inv.borderSpacing, mMetrics, 1f));
+        allAppsCellSpacingPx = pxFromDp(inv.allAppsCellSpacing, mMetrics, 1f);
         cellLayoutBorderSpacingOriginalPx = cellLayoutBorderSpacingPx;
         folderCellLayoutBorderSpacingPx = cellLayoutBorderSpacingPx;
 
@@ -547,6 +550,17 @@
                 + textHeight + (topBottomPadding * 2);
     }
 
+    private void updateAllAppsWidth() {
+        if (isTwoPanels) {
+            int usedWidth = (allAppsCellWidthPx * numShownAllAppsColumns)
+                    + (allAppsCellSpacingPx * (numShownAllAppsColumns + 1));
+            allAppsLeftRightPadding = Math.max(1, (availableWidthPx - usedWidth) / 2);
+        } else {
+            allAppsLeftRightPadding =
+                    desiredWorkspaceLeftRightMarginPx + cellLayoutPaddingLeftRightPx;
+        }
+    }
+
     /**
      * Returns the amount of extra (or unused) vertical space.
      */
@@ -666,6 +680,7 @@
             allAppsCellHeightPx = getCellSize().y;
         }
         allAppsCellWidthPx = allAppsIconSizePx + allAppsIconDrawablePaddingPx;
+        updateAllAppsWidth();
 
         if (isVerticalLayout) {
             hideWorkspaceLabelsIfNotEnoughSpace();
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index b3ae15e..e86c02c 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -151,7 +151,8 @@
             }
             return mWorkspace.onTouchEvent(event);
         }
-        return event.getY() > getCellHeight();
+        // Always let touch follow through to Workspace.
+        return false;
     }
 
     @Override
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 5f441d1..8631040 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -108,6 +108,7 @@
     public float iconTextSize;
     public float allAppsIconSize;
     public float allAppsIconTextSize;
+    public float allAppsCellSpacing;
     public boolean isSplitDisplay;
 
     public float minCellHeight;
@@ -153,7 +154,8 @@
      */
     public List<DeviceProfile> supportedProfiles = Collections.EMPTY_LIST;
 
-    @Nullable public DevicePaddings devicePaddings;
+    @Nullable
+    public DevicePaddings devicePaddings;
 
     public Point defaultWallpaperSize;
     public Rect defaultWidgetPadding;
@@ -161,7 +163,8 @@
     private final ArrayList<OnIDPChangeListener> mChangeListeners = new ArrayList<>();
 
     @VisibleForTesting
-    public InvariantDeviceProfile() {}
+    public InvariantDeviceProfile() {
+    }
 
     @TargetApi(23)
     private InvariantDeviceProfile(Context context) {
@@ -219,6 +222,7 @@
         result.minCellHeight = defaultDisplayOption.minCellHeight;
         result.minCellWidth = defaultDisplayOption.minCellWidth;
         result.borderSpacing = defaultDisplayOption.borderSpacing;
+        result.allAppsCellSpacing = defaultDisplayOption.allAppsCellSpacing;
 
         initGrid(context, myInfo, result, false);
     }
@@ -283,6 +287,7 @@
         twoPanelLandscapeMinCellHeightDps = displayOption.twoPanelLandscapeMinCellHeightDps;
         twoPanelLandscapeMinCellWidthDps = displayOption.twoPanelLandscapeMinCellWidthDps;
         borderSpacing = displayOption.borderSpacing;
+        allAppsCellSpacing = displayOption.allAppsCellSpacing;
 
         numShownHotseatIcons = closestProfile.numHotseatIcons;
         numDatabaseHotseatIcons = isSplitDisplay
@@ -356,7 +361,7 @@
     }
 
     private Object[] toModelState() {
-        return new Object[] {
+        return new Object[]{
                 numColumns, numRows, numDatabaseHotseatIcons, iconBitmapSize, fillResIconDpi,
                 numDatabaseAllAppsColumns, dbFile};
     }
@@ -402,7 +407,7 @@
                     }
                 }
             }
-        } catch (IOException|XmlPullParserException e) {
+        } catch (IOException | XmlPullParserException e) {
             throw new RuntimeException(e);
         }
 
@@ -456,7 +461,7 @@
 
     private int getLauncherIconDensity(int requiredSize) {
         // Densities typically defined by an app.
-        int[] densityBuckets = new int[] {
+        int[] densityBuckets = new int[]{
                 DisplayMetrics.DENSITY_LOW,
                 DisplayMetrics.DENSITY_MEDIUM,
                 DisplayMetrics.DENSITY_TV,
@@ -596,8 +601,8 @@
         // We will use these two data points to extrapolate how much the wallpaper parallax effect
         // to span (ie travel) at any aspect ratio:
 
-        final float ASPECT_RATIO_LANDSCAPE = 16/10f;
-        final float ASPECT_RATIO_PORTRAIT = 10/16f;
+        final float ASPECT_RATIO_LANDSCAPE = 16 / 10f;
+        final float ASPECT_RATIO_PORTRAIT = 10 / 16f;
         final float WALLPAPER_WIDTH_TO_SCREEN_RATIO_LANDSCAPE = 1.5f;
         final float WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT = 1.2f;
 
@@ -607,7 +612,8 @@
         //   (10/16)x + y = 1.2
         // We solve for x and y and end up with a final formula:
         final float x =
-                (WALLPAPER_WIDTH_TO_SCREEN_RATIO_LANDSCAPE - WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT) /
+                (WALLPAPER_WIDTH_TO_SCREEN_RATIO_LANDSCAPE
+                        - WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT) /
                         (ASPECT_RATIO_LANDSCAPE - ASPECT_RATIO_PORTRAIT);
         final float y = WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT - x * ASPECT_RATIO_PORTRAIT;
         return x * aspectRatio + y;
@@ -719,6 +725,7 @@
         private float twoPanelPortraitMinCellWidthDps;
         private float twoPanelLandscapeMinCellHeightDps;
         private float twoPanelLandscapeMinCellWidthDps;
+        private float allAppsCellSpacing;
         private float borderSpacing;
 
         private final float[] iconSizes = new float[COUNT_TOTAL];
@@ -750,6 +757,8 @@
                     R.styleable.ProfileDisplayOption_twoPanelLandscapeMinCellWidthDps,
                     twoPanelPortraitMinCellWidthDps);
             borderSpacing = a.getFloat(R.styleable.ProfileDisplayOption_borderSpacingDps, 0);
+            allAppsCellSpacing = a.getFloat(R.styleable.ProfileDisplayOption_allAppsCellSpacingDps,
+                    borderSpacing);
 
             iconSizes[INDEX_DEFAULT] =
                     a.getFloat(R.styleable.ProfileDisplayOption_iconImageSize, 0);
@@ -810,6 +819,7 @@
             twoPanelLandscapeMinCellHeightDps *= w;
             twoPanelLandscapeMinCellWidthDps *= w;
             borderSpacing *= w;
+            allAppsCellSpacing *= w;
             return this;
         }
 
@@ -825,6 +835,7 @@
             twoPanelLandscapeMinCellHeightDps += p.twoPanelLandscapeMinCellHeightDps;
             twoPanelLandscapeMinCellWidthDps += p.twoPanelLandscapeMinCellWidthDps;
             borderSpacing += p.borderSpacing;
+            allAppsCellSpacing += p.allAppsCellSpacing;
             return this;
         }
     }
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 8a35185..71c032a 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -23,9 +23,11 @@
 import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
 
 import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
+import static com.android.launcher3.AbstractFloatingView.TYPE_FOLDER;
 import static com.android.launcher3.AbstractFloatingView.TYPE_ICON_SURFACE;
 import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
 import static com.android.launcher3.AbstractFloatingView.TYPE_SNACKBAR;
+import static com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType;
 import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY;
 import static com.android.launcher3.LauncherState.ALL_APPS;
 import static com.android.launcher3.LauncherState.FLAG_CLOSE_POPUPS;
@@ -2116,8 +2118,16 @@
 
     @Override
     public IntSet getPagesToBindSynchronously(IntArray orderedScreenIds) {
-        IntSet visibleIds = mPagesToBindSynchronously.isEmpty()
-                ? mWorkspace.getCurrentPageScreenIds() : mPagesToBindSynchronously;
+        IntSet visibleIds;
+        if (!mPagesToBindSynchronously.isEmpty()) {
+            visibleIds = mPagesToBindSynchronously;
+        } else if (!mWorkspaceLoading) {
+            visibleIds = mWorkspace.getCurrentPageScreenIds();
+        } else {
+            // If workspace binding is still in progress, getCurrentPageScreenIds won't be accurate,
+            // and we should use mSynchronouslyBoundPages that's set during initial binding.
+            visibleIds = mSynchronouslyBoundPages;
+        }
         IntArray actualIds = new IntArray();
 
         IntSet result = new IntSet();
@@ -2287,7 +2297,7 @@
             final boolean focusFirstItemForAccessibility) {
         // Get the list of added items and intersect them with the set of items here
         final Collection<Animator> bounceAnims = new ArrayList<>();
-        final boolean animateIcons = forceAnimateIcons && canRunNewAppsAnimation();
+        boolean canAnimatePageChange = canAnimatePageChange();
         Workspace workspace = mWorkspace;
         int newItemsScreenId = -1;
         int end = items.size();
@@ -2348,7 +2358,7 @@
                 }
             }
             workspace.addInScreenFromBind(view, item);
-            if (animateIcons) {
+            if (forceAnimateIcons) {
                 // Animate all the applications up now
                 view.setAlpha(0f);
                 view.setScaleX(0f);
@@ -2364,7 +2374,7 @@
 
         View viewToFocus = newView;
         // Animate to the correct pager
-        if (animateIcons && newItemsScreenId > -1) {
+        if (forceAnimateIcons && newItemsScreenId > -1) {
             AnimatorSet anim = new AnimatorSet();
             anim.playTogether(bounceAnims);
             if (focusFirstItemForAccessibility && viewToFocus != null) {
@@ -2380,7 +2390,7 @@
             final int newScreenIndex = mWorkspace.getPageIndexForScreenId(newItemsScreenId);
             final Runnable startBounceAnimRunnable = anim::start;
 
-            if (newItemsScreenId != currentScreenId) {
+            if (canAnimatePageChange && newItemsScreenId != currentScreenId) {
                 // We post the animation slightly delayed to prevent slowdowns
                 // when we are loading right after we return to launcher.
                 mWorkspace.postDelayed(new Runnable() {
@@ -2661,7 +2671,7 @@
         TraceHelper.INSTANCE.endSection(traceToken);
     }
 
-    private boolean canRunNewAppsAnimation() {
+    private boolean canAnimatePageChange() {
         if (mDragController.isDragging()) {
             return false;
         } else {
@@ -2901,13 +2911,26 @@
      * Shows the default options popup
      */
     public void showDefaultOptions(float x, float y) {
+        OptionsPopupView.show(this, getPopupTarget(x, y), OptionsPopupView.getOptions(this),
+                false);
+    }
+
+    /**
+     * Returns target rectangle for anchoring a popup menu.
+     */
+    protected RectF getPopupTarget(float x, float y) {
         float halfSize = getResources().getDimension(R.dimen.options_menu_thumb_size) / 2;
         if (x < 0 || y < 0) {
             x = mDragLayer.getWidth() / 2;
             y = mDragLayer.getHeight() / 2;
         }
-        RectF target = new RectF(x - halfSize, y - halfSize, x + halfSize, y + halfSize);
-        OptionsPopupView.show(this, target, OptionsPopupView.getOptions(this), false);
+        return new RectF(x - halfSize, y - halfSize, x + halfSize, y + halfSize);
+    }
+
+    @Override
+    public boolean shouldUseColorExtractionForPopup() {
+        return getTopOpenViewWithType(this, TYPE_FOLDER) == null
+                && getStateManager().getState() != LauncherState.ALL_APPS;
     }
 
     @Override
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 9a5fd05..3f1f915 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -382,12 +382,10 @@
     public void setInsets(Rect insets) {
         mInsets.set(insets);
         DeviceProfile grid = mLauncher.getDeviceProfile();
-        int leftRightPadding = grid.desiredWorkspaceLeftRightMarginPx
-                + grid.cellLayoutPaddingLeftRightPx;
 
         for (int i = 0; i < mAH.length; i++) {
             mAH[i].padding.bottom = insets.bottom;
-            mAH[i].padding.left = mAH[i].padding.right = leftRightPadding;
+            mAH[i].padding.left = mAH[i].padding.right = grid.allAppsLeftRightPadding;
             mAH[i].applyPadding();
         }
 
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 49e0171..e89549d 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -166,9 +166,6 @@
             "ENABLE_OVERVIEW_SHARING_TO_PEOPLE", true,
             "Show indicators for content on Overview to share with top people. ");
 
-    public static final BooleanFlag ENABLE_OVERVIEW_CONTENT_PUSH = getDebugFlag(
-            "ENABLE_OVERVIEW_CONTENT_PUSH", false, "Show Content Push button in Overview Actions");
-
     public static final BooleanFlag ENABLE_DATABASE_RESTORE = getDebugFlag(
             "ENABLE_DATABASE_RESTORE", false,
             "Enable database restore when new restore session is created");
diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java
index 112a24e..2230914 100644
--- a/src/com/android/launcher3/popup/ArrowPopup.java
+++ b/src/com/android/launcher3/popup/ArrowPopup.java
@@ -51,21 +51,20 @@
 import androidx.annotation.NonNull;
 
 import com.android.launcher3.AbstractFloatingView;
-import com.android.launcher3.BaseDraggingActivity;
 import com.android.launcher3.InsettableFrameLayout;
 import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherState;
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.Workspace;
 import com.android.launcher3.dragndrop.DragLayer;
 import com.android.launcher3.shortcuts.DeepShortcutView;
-import com.android.launcher3.statemanager.StatefulActivity;
 import com.android.launcher3.util.Themes;
+import com.android.launcher3.views.ActivityContext;
 import com.android.launcher3.views.BaseDragLayer;
 import com.android.launcher3.widget.LocalColorExtractor;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -74,7 +73,7 @@
  *
  * @param <T> The activity on with the popup shows
  */
-public abstract class ArrowPopup<T extends StatefulActivity<LauncherState>>
+public abstract class ArrowPopup<T extends Context & ActivityContext>
         extends AbstractFloatingView {
 
     // Duration values (ms) for popup open and close animations.
@@ -98,7 +97,7 @@
 
     protected final LayoutInflater mInflater;
     private final float mOutlineRadius;
-    protected final T mLauncher;
+    protected final T mActivityContext;
     protected final boolean mIsRtl;
 
     private final int mArrowOffsetVertical;
@@ -131,13 +130,13 @@
 
     private final String mIterateChildrenTag;
 
-    private final int[] mColors;
+    private final int[] mColorIds;
 
     public ArrowPopup(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
         mInflater = LayoutInflater.from(context);
         mOutlineRadius = Themes.getDialogCornerRadius(context);
-        mLauncher = BaseDraggingActivity.fromContext(context);
+        mActivityContext = ActivityContext.lookupContext(context);
         mIsRtl = Utilities.isRtl(getResources());
 
         mBackgroundColor = Themes.getAttrColor(context, R.attr.popupColorPrimary);
@@ -169,22 +168,18 @@
 
         mIterateChildrenTag = getContext().getString(R.string.popup_container_iterate_children);
 
-        boolean isAboveAnotherSurface = getTopOpenViewWithType(mLauncher, TYPE_FOLDER) != null
-                || mLauncher.getStateManager().getState() == LauncherState.ALL_APPS;
-        if (!isAboveAnotherSurface && Utilities.ATLEAST_S && ENABLE_LOCAL_COLOR_POPUPS.get()) {
+        boolean shouldUseColorExtraction = mActivityContext.shouldUseColorExtractionForPopup();
+        if (shouldUseColorExtraction && Utilities.ATLEAST_S && ENABLE_LOCAL_COLOR_POPUPS.get()) {
             mColorExtractors = new ArrayList<>();
         } else {
             mColorExtractors = null;
         }
 
-        if (isAboveAnotherSurface) {
-            mColors = new int[] {
-                    getColorStateList(context, R.color.popup_shade_first).getDefaultColor()};
+        if (shouldUseColorExtraction) {
+            mColorIds = new int[]{R.color.popup_shade_first, R.color.popup_shade_second,
+                    R.color.popup_shade_third};
         } else {
-            mColors = new int[] {
-                    getColorStateList(context, R.color.popup_shade_first).getDefaultColor(),
-                    getColorStateList(context, R.color.popup_shade_second).getDefaultColor(),
-                    getColorStateList(context, R.color.popup_shade_third).getDefaultColor()};
+            mColorIds = new int[]{R.color.popup_shade_first};
         }
     }
 
@@ -236,17 +231,22 @@
     }
 
     /**
-     * @param backgroundColor When Color.TRANSPARENT, we get color from {@link #mColors}.
+     * @param backgroundColor When Color.TRANSPARENT, we get color from {@link #mColorIds}.
      *                        Otherwise, we will use this color for all child views.
      */
     private void assignMarginsAndBackgrounds(ViewGroup viewGroup, int backgroundColor) {
-        final boolean getColorFromColorArray = backgroundColor == Color.TRANSPARENT;
+        int[] colors = null;
+        if (backgroundColor == Color.TRANSPARENT) {
+            // Lazily get the colors so they match the current wallpaper colors.
+            colors = Arrays.stream(mColorIds).map(
+                    r -> getColorStateList(getContext(), r).getDefaultColor()).toArray();
+        }
 
         int count = viewGroup.getChildCount();
         int totalVisibleShortcuts = 0;
         for (int i = 0; i < count; i++) {
             View view = viewGroup.getChildAt(i);
-            if (view.getVisibility() == VISIBLE && view instanceof DeepShortcutView) {
+            if (view.getVisibility() == VISIBLE && isShortcutOrWrapper(view)) {
                 totalVisibleShortcuts++;
             }
         }
@@ -266,9 +266,17 @@
                 MarginLayoutParams mlp = (MarginLayoutParams) lastView.getLayoutParams();
                 mlp.bottomMargin = 0;
 
+                if (colors != null) {
+                    backgroundColor = colors[numVisibleChild % colors.length];
+                }
 
-                if (getColorFromColorArray) {
-                    backgroundColor = mColors[numVisibleChild % mColors.length];
+                if (!ENABLE_LOCAL_COLOR_POPUPS.get()) {
+                    // Arrow color matches the first child or the last child.
+                    if (!mIsAboveIcon && numVisibleChild == 0 && viewGroup == this) {
+                        mArrowColor = backgroundColor;
+                    } else if (mIsAboveIcon) {
+                        mArrowColor = backgroundColor;
+                    }
                 }
 
                 if (view instanceof ViewGroup && mIterateChildrenTag.equals(view.getTag())) {
@@ -277,7 +285,7 @@
                     continue;
                 }
 
-                if (view instanceof DeepShortcutView) {
+                if (isShortcutOrWrapper(view)) {
                     if (totalVisibleShortcuts == 1) {
                         view.setBackgroundResource(R.drawable.single_item_primary);
                     } else if (totalVisibleShortcuts > 1) {
@@ -294,12 +302,6 @@
 
                 if (!ENABLE_LOCAL_COLOR_POPUPS.get()) {
                     setChildColor(view, backgroundColor, colorAnimator);
-                    // Arrow color matches the first child or the last child.
-                    if (!mIsAboveIcon && numVisibleChild == 0) {
-                        mArrowColor = backgroundColor;
-                    } else if (mIsAboveIcon) {
-                        mArrowColor = backgroundColor;
-                    }
                 }
 
                 numVisibleChild++;
@@ -310,6 +312,12 @@
         measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
     }
 
+    /**
+     * Returns {@code true} if the child is a shortcut or wraps a shortcut.
+     */
+    protected boolean isShortcutOrWrapper(View view) {
+        return view instanceof DeepShortcutView;
+    }
 
     @TargetApi(Build.VERSION_CODES.S)
     private int getExtractedColor(SparseIntArray colors) {
@@ -427,7 +435,7 @@
     /**
      * Shows the popup at the desired location.
      */
-    protected void show() {
+    public void show() {
         setupForDisplay();
         onInflationComplete(false);
         assignMarginsAndBackgrounds(this);
@@ -490,7 +498,7 @@
         mArrow.setPivotY(mIsAboveIcon ? mArrowHeight : 0);
     }
 
-    private void updateArrowColor() {
+    protected void updateArrowColor() {
         if (!Gravity.isVertical(mGravity)) {
             mArrow.setBackground(new RoundedArrowDrawable(
                     mArrowWidth, mArrowHeight, mArrowPointRadius,
@@ -807,6 +815,6 @@
     }
 
     protected BaseDragLayer getPopupContainer() {
-        return mLauncher.getDragLayer();
+        return mActivityContext.getDragLayer();
     }
 }
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index 454dc6e..65dd8ea 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -151,7 +151,7 @@
 
     public OnClickListener getItemClickListener() {
         return (view) -> {
-            mLauncher.getItemOnClickListener().onClick(view);
+            mActivityContext.getItemOnClickListener().onClick(view);
             close(true);
         };
     }
@@ -326,7 +326,7 @@
 
         // Load the shortcuts on a background thread and update the container as it animates.
         MODEL_EXECUTOR.getHandler().postAtFrontOfQueue(PopupPopulator.createUpdateRunnable(
-                mLauncher, originalItemInfo, new Handler(Looper.getMainLooper()),
+                mActivityContext, originalItemInfo, new Handler(Looper.getMainLooper()),
                 this, mShortcuts, notificationKeys));
     }
 
@@ -439,7 +439,7 @@
 
     private void updateNotificationHeader() {
         ItemInfoWithIcon itemInfo = (ItemInfoWithIcon) mOriginalIcon.getTag();
-        DotInfo dotInfo = mLauncher.getDotInfoForItem(itemInfo);
+        DotInfo dotInfo = mActivityContext.getDotInfoForItem(itemInfo);
         if (mNotificationContainer != null && dotInfo != null) {
             mNotificationContainer.updateHeader(dotInfo.getNotificationCount());
         }
@@ -481,7 +481,7 @@
     @Override
     protected void closeComplete() {
         super.closeComplete();
-        PopupContainerWithArrow openPopup = getOpen(mLauncher);
+        PopupContainerWithArrow openPopup = getOpen(mActivityContext);
         if (openPopup == null || openPopup.mOriginalIcon != mOriginalIcon) {
             mOriginalIcon.setTextVisibility(mOriginalIcon.shouldTextBeVisible());
             mOriginalIcon.setForceHideDot(false);
@@ -593,6 +593,7 @@
                 mNotificationContainer.setVisibility(GONE);
                 updateHiddenShortcuts();
                 assignMarginsAndBackgrounds(PopupContainerWithArrow.this);
+                updateArrowColor();
             } else {
                 mNotificationContainer.trimNotifications(
                         NotificationKeyData.extractKeysOnly(dotInfo.getNotificationKeys()));
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java
index 3aecaa5..304e76a 100644
--- a/src/com/android/launcher3/testing/TestProtocol.java
+++ b/src/com/android/launcher3/testing/TestProtocol.java
@@ -99,6 +99,11 @@
     public static final String REQUEST_CLEAR_DATA = "clear-data";
     public static final String REQUEST_IS_TABLET = "is-tablet";
     public static final String REQUEST_IS_TWO_PANELS = "is-two-panel";
+    public static final String REQUEST_GET_ACTIVITIES_CREATED_COUNT =
+            "get-activities-created-count";
+    public static final String REQUEST_GET_ACTIVITIES = "get-activities";
+    public static final String REQUEST_GET_FOCUSED_TASK_WIDTH_FOR_TABLET =
+            "get-focused-task-width-for-tablet";
 
     public static Long sForcePauseTimeout;
     public static final String REQUEST_SET_FORCE_PAUSE_TIMEOUT = "set-force-pause-timeout";
@@ -108,8 +113,6 @@
     public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing";
 
     public static final String REQUEST_OVERVIEW_SHARE_ENABLED = "overview-share-enabled";
-    public static final String REQUEST_OVERVIEW_CONTENT_PUSH_ENABLED =
-            "overview-content-push-enabled";
 
     public static boolean sDisableSensorRotation;
     public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation";
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index 3ac25f2..a190f52 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -31,7 +31,6 @@
 import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_TYPE_MAIN;
 
 import android.content.res.Resources;
-import android.graphics.Point;
 import android.graphics.PointF;
 import android.graphics.Rect;
 import android.graphics.RectF;
@@ -389,15 +388,6 @@
     }
 
     @Override
-    public void setLeashSplitOffset(Point splitOffset, DeviceProfile dp,
-            StagedSplitBounds splitInfo, int desiredStagePosition) {
-        if (desiredStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
-            // The preview set is for the bottom/right, inset by top/left task
-            splitOffset.x = splitInfo.leftTopBounds.width() + splitInfo.visualDividerBounds.width();
-        }
-    }
-
-    @Override
     public void measureGroupedTaskViewThumbnailBounds(View primarySnapshot, View secondarySnapshot,
             int parentWidth, int parentHeight,
             SplitConfigurationOptions.StagedSplitBounds splitBoundsConfig, DeviceProfile dp) {
diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java
index 19d73a8..8112afd 100644
--- a/src/com/android/launcher3/touch/PagedOrientationHandler.java
+++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java
@@ -19,7 +19,6 @@
 import android.content.res.Resources;
 import android.graphics.Canvas;
 import android.graphics.Matrix;
-import android.graphics.Point;
 import android.graphics.PointF;
 import android.graphics.Rect;
 import android.graphics.RectF;
@@ -146,21 +145,6 @@
             StagedSplitBounds splitInfo,
             @SplitConfigurationOptions.StagePosition int desiredStagePosition);
 
-    /**
-     * It's important to note that {@link #setSplitTaskSwipeRect(DeviceProfile, Rect,
-     * StagedSplitBounds, int)} above operates on the outRect based on
-     * launcher's coordinate system, meaning it will treat the outRect as portrait if home rotation
-     * is not allowed.
-     *
-     * However, here the splitOffset is from perspective of TaskViewSimulator, which is in display
-     * orientation coordinates. So, for example, for the fake landscape scenario, even though
-     * launcher is portrait, we inset the bottom/right task by an X coordinate instead of the
-     * usual Y
-     */
-    void setLeashSplitOffset(Point splitOffset, DeviceProfile dp,
-            StagedSplitBounds splitInfo,
-            @SplitConfigurationOptions.StagePosition int desiredStagePosition);
-
     void measureGroupedTaskViewThumbnailBounds(View primarySnapshot, View secondarySnapshot,
             int parentWidth, int parentHeight,
             SplitConfigurationOptions.StagedSplitBounds splitBoundsConfig, DeviceProfile dp);
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index 1b8ebd8..576c6f5 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -31,7 +31,6 @@
 
 import android.content.res.Resources;
 import android.graphics.Matrix;
-import android.graphics.Point;
 import android.graphics.PointF;
 import android.graphics.Rect;
 import android.graphics.RectF;
@@ -476,22 +475,6 @@
     }
 
     @Override
-    public void setLeashSplitOffset(Point splitOffset, DeviceProfile dp,
-            StagedSplitBounds splitInfo, int desiredStagePosition) {
-        if (desiredStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
-            if (dp.isLandscape) {
-                splitOffset.x = splitInfo.leftTopBounds.width() +
-                        splitInfo.visualDividerBounds.width();
-                splitOffset.y = 0;
-            } else {
-                splitOffset.y = splitInfo.leftTopBounds.height() +
-                        splitInfo.visualDividerBounds.height();
-                splitOffset.x = 0;
-            }
-        }
-    }
-
-    @Override
     public void measureGroupedTaskViewThumbnailBounds(View primarySnapshot, View secondarySnapshot,
             int parentWidth, int parentHeight,
             SplitConfigurationOptions.StagedSplitBounds splitBoundsConfig, DeviceProfile dp) {
diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java
index ebcd379..e07d71e 100644
--- a/src/com/android/launcher3/views/ActivityContext.java
+++ b/src/com/android/launcher3/views/ActivityContext.java
@@ -116,6 +116,13 @@
     }
 
     /**
+     * Returns {@code true} if popups should use color extraction.
+     */
+    default boolean shouldUseColorExtractionForPopup() {
+        return true;
+    }
+
+    /**
      * Returns whether we can show the IME for elements hosted by this ActivityContext.
      */
     default boolean supportsIme() {
diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java
index 257b18f..33ab0d2 100644
--- a/src/com/android/launcher3/views/OptionsPopupView.java
+++ b/src/com/android/launcher3/views/OptionsPopupView.java
@@ -59,7 +59,7 @@
 /**
  * Popup shown on long pressing an empty space in launcher
  */
-public class OptionsPopupView extends ArrowPopup
+public class OptionsPopupView extends ArrowPopup<Launcher>
         implements OnClickListener, OnLongClickListener {
 
     private final ArrayMap<View, OptionItem> mItemMap = new ArrayMap<>();
@@ -74,6 +74,10 @@
         super(context, attrs, defStyleAttr);
     }
 
+    public void setTargetRect(RectF targetRect) {
+        mTargetRect = targetRect;
+    }
+
     @Override
     public void onClick(View view) {
         handleViewClick(view);
@@ -90,7 +94,7 @@
             return false;
         }
         if (item.eventId.getId() > 0) {
-            mLauncher.getStatsLogManager().logger().log(item.eventId);
+            mActivityContext.getStatsLogManager().logger().log(item.eventId);
         }
         if (item.clickListener.onLongClick(view)) {
             close(true);
diff --git a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
index 57a6d3f..b6bb6aa 100644
--- a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
+++ b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
@@ -268,8 +268,8 @@
             if (availableWidth > 0) {
                 // Recreate the setup text.
                 mSetupTextLayout = new StaticLayout(
-                        getResources().getText(R.string.gadget_setup_text), mPaint, availableWidth,
-                        Layout.Alignment.ALIGN_CENTER, 1, 0, true);
+                        getResources().getText(R.string.gadget_complete_setup_text), mPaint,
+                        availableWidth, Layout.Alignment.ALIGN_CENTER, 1, 0, true);
                 int textHeight = mSetupTextLayout.getHeight();
 
                 // Extra icon size due to the setting icon
diff --git a/src/com/android/launcher3/widget/WidgetsBottomSheet.java b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
index 68532ca..b152ddc 100644
--- a/src/com/android/launcher3/widget/WidgetsBottomSheet.java
+++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
@@ -183,15 +183,16 @@
         TableLayout widgetsTable = findViewById(R.id.widgets_table);
         widgetsTable.removeAllViews();
 
-        WidgetsTableUtils.groupWidgetItemsIntoTable(widgets, mMaxHorizontalSpan).forEach(row -> {
-            TableRow tableRow = new TableRow(getContext());
-            tableRow.setGravity(Gravity.TOP);
-            row.forEach(widgetItem -> {
-                WidgetCell widget = addItemCell(tableRow);
-                widget.applyFromCellItem(widgetItem);
-            });
-            widgetsTable.addView(tableRow);
-        });
+        WidgetsTableUtils.groupWidgetItemsIntoTableWithReordering(widgets, mMaxHorizontalSpan)
+                .forEach(row -> {
+                    TableRow tableRow = new TableRow(getContext());
+                    tableRow.setGravity(Gravity.TOP);
+                    row.forEach(widgetItem -> {
+                        WidgetCell widget = addItemCell(tableRow);
+                        widget.applyFromCellItem(widgetItem);
+                    });
+                    widgetsTable.addView(tableRow);
+                });
     }
 
     @Override
diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
index 9e12f6f..894c4c9 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
@@ -535,8 +535,8 @@
                     - noWidgetsViewHeight) * RECOMMENDATION_TABLE_HEIGHT_RATIO;
 
             List<ArrayList<WidgetItem>> recommendedWidgetsInTable =
-                    WidgetsTableUtils.groupWidgetItemsIntoTable(recommendedWidgets,
-                            mMaxSpansPerRow);
+                    WidgetsTableUtils.groupWidgetItemsIntoTableWithoutReordering(
+                            recommendedWidgets, mMaxSpansPerRow);
             table.setRecommendedWidgets(recommendedWidgetsInTable, maxTableHeight);
         } else {
             table.setVisibility(GONE);
diff --git a/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinder.java b/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinder.java
index 8c9ff09..05e26ad 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinder.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsListTableViewHolderBinder.java
@@ -93,7 +93,7 @@
         }
         table.setListDrawableState(((position & POSITION_LAST) != 0) ? LAST : MIDDLE);
         List<ArrayList<WidgetItem>> widgetItemsTable =
-                WidgetsTableUtils.groupWidgetItemsIntoTable(
+                WidgetsTableUtils.groupWidgetItemsIntoTableWithReordering(
                         entry.mWidgets, entry.getMaxSpanSizeInCells());
         recycleTableBeforeBinding(table, widgetItemsTable);
 
diff --git a/src/com/android/launcher3/widget/util/WidgetSizes.java b/src/com/android/launcher3/widget/util/WidgetSizes.java
index 451ed6e..b211f4c 100644
--- a/src/com/android/launcher3/widget/util/WidgetSizes.java
+++ b/src/com/android/launcher3/widget/util/WidgetSizes.java
@@ -17,7 +17,6 @@
 
 import static android.appwidget.AppWidgetHostView.getDefaultPaddingForWidget;
 
-
 import android.appwidget.AppWidgetHostView;
 import android.appwidget.AppWidgetManager;
 import android.content.ComponentName;
@@ -87,7 +86,13 @@
     }
 
     /**
-     * Returns the size of a WidgetItem.
+     * Returns the size of a {@link WidgetItem}.
+     *
+     * <p>This size is used by the widget picker. It should NEVER be shared with app widgets.
+     *
+     * <p>For sizes shared with app widgets, please refer to
+     * {@link #getWidgetPaddedSizes(Context, ComponentName, int, int)} &
+     * {@link #getWidgetPaddedSizePx(Context, ComponentName, DeviceProfile, int, int)}.
      */
     public static Size getWidgetItemSizePx(Context context, DeviceProfile profile,
             WidgetItem widgetItem) {
@@ -96,8 +101,15 @@
                     .getDimensionPixelSize(R.dimen.widget_preview_shortcut_padding);
             return new Size(dimension, dimension);
         }
-        return getWidgetPaddedSizePx(context, widgetItem.componentName, profile, widgetItem.spanX,
-                widgetItem.spanY);
+        Size widgetItemSize = getWidgetSizePx(profile, widgetItem.spanX,
+                widgetItem.spanY, /* recycledCellSize= */ null);
+        if (profile.shouldInsetWidgets()) {
+            Rect inset = new Rect();
+            AppWidgetHostView.getDefaultPaddingForWidget(context, widgetItem.componentName, inset);
+            return new Size(widgetItemSize.getWidth() + inset.left + inset.right,
+                    widgetItemSize.getHeight() + inset.top + inset.bottom);
+        }
+        return widgetItemSize;
     }
 
     private static Size getWidgetSizePx(DeviceProfile profile, int spanX, int spanY,
diff --git a/src/com/android/launcher3/widget/util/WidgetsTableUtils.java b/src/com/android/launcher3/widget/util/WidgetsTableUtils.java
index 54aaf93..72e27bf 100644
--- a/src/com/android/launcher3/widget/util/WidgetsTableUtils.java
+++ b/src/com/android/launcher3/widget/util/WidgetsTableUtils.java
@@ -45,9 +45,20 @@
         return item.spanX > otherItem.spanX ? 1 : -1;
     };
 
+    /**
+     * Groups {@code widgetItems} items into a 2D array which matches their appearance in a UI
+     * table. This takes liberty to rearrange widgets to make the table visually appealing.
+     */
+    public static List<ArrayList<WidgetItem>> groupWidgetItemsIntoTableWithReordering(
+            List<WidgetItem> widgetItems, final int maxSpansPerRow) {
+        List<WidgetItem> sortedWidgetItems = widgetItems.stream().sorted(WIDGET_SHORTCUT_COMPARATOR)
+                .collect(Collectors.toList());
+        return groupWidgetItemsIntoTableWithoutReordering(sortedWidgetItems, maxSpansPerRow);
+    }
 
     /**
-     * Groups widgets items into a 2D array which matches their appearance in a UI table.
+     * Groups {@code widgetItems} into a 2D array which matches their appearance in a UI table while
+     * maintaining their order.
      *
      * <p>Grouping:
      * 1. Widgets and shortcuts never group together in the same row.
@@ -64,13 +75,12 @@
      * should be moved to a new row.
      * Example 3: Row 1: 6x4. This is okay because this is the only item in the row.
      */
-    public static List<ArrayList<WidgetItem>> groupWidgetItemsIntoTable(
+    public static List<ArrayList<WidgetItem>> groupWidgetItemsIntoTableWithoutReordering(
             List<WidgetItem> widgetItems, final int maxSpansPerRow) {
-        List<WidgetItem> sortedWidgetItems = widgetItems.stream().sorted(WIDGET_SHORTCUT_COMPARATOR)
-                .collect(Collectors.toList());
+
         List<ArrayList<WidgetItem>> widgetItemsTable = new ArrayList<>();
         ArrayList<WidgetItem> widgetItemsAtRow = null;
-        for (WidgetItem widgetItem : sortedWidgetItems) {
+        for (WidgetItem widgetItem : widgetItems) {
             if (widgetItemsAtRow == null) {
                 widgetItemsAtRow = new ArrayList<>();
                 widgetItemsTable.add(widgetItemsAtRow);
diff --git a/src_plugins/com/android/systemui/plugins/OverviewScreenshotActions.java b/src_plugins/com/android/systemui/plugins/OverviewScreenshotActions.java
deleted file mode 100644
index 8d9c0f4..0000000
--- a/src_plugins/com/android/systemui/plugins/OverviewScreenshotActions.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.plugins;
-
-import android.app.Activity;
-import android.graphics.Bitmap;
-import android.view.ViewGroup;
-
-import com.android.systemui.plugins.annotations.ProvidesInterface;
-
-/**
- * Implement this interface to add action buttons for overview screenshots, e.g. share, edit etc.
- */
-@ProvidesInterface(
-        action = OverviewScreenshotActions.ACTION, version = OverviewScreenshotActions.VERSION)
-public interface OverviewScreenshotActions extends Plugin {
-    String ACTION = "com.android.systemui.action.PLUGIN_OVERVIEW_SCREENSHOT_ACTIONS";
-    int VERSION = 1;
-
-    /**
-     * Setup the actions for the screenshot, including edit, save, etc.
-     * @param parent The parent view to add buttons on.
-     * @param screenshot The screenshot we will do actions on.
-     * @param activity THe host activity.
-     */
-    void setupActions(ViewGroup parent, Bitmap screenshot, Activity activity);
-}
diff --git a/src_plugins/com/android/systemui/plugins/RecentsExtraCard.java b/src_plugins/com/android/systemui/plugins/RecentsExtraCard.java
deleted file mode 100644
index cd9f33d..0000000
--- a/src_plugins/com/android/systemui/plugins/RecentsExtraCard.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.plugins;
-
-import android.app.Activity;
-import android.content.Context;
-import android.widget.FrameLayout;
-
-import com.android.systemui.plugins.annotations.ProvidesInterface;
-
-/**
- * Implement this interface to allow extra card on recents overview.
- */
-@ProvidesInterface(action = RecentsExtraCard.ACTION, version = RecentsExtraCard.VERSION)
-public interface RecentsExtraCard extends Plugin {
-
-    String ACTION = "com.android.systemui.action.PLUGIN_RECENTS_EXTRA_CARD";
-    int VERSION = 1;
-
-    /**
-     * Sets up the recents overview extra card and fills in data.
-     *
-     * @param context     Plugin context
-     * @param frameLayout PlaceholderView
-     * @param activity    Recents activity to hold extra view
-     */
-    void setupView(Context context, FrameLayout frameLayout, Activity activity);
-}
diff --git a/tests/Android.bp b/tests/Android.bp
index aeddc4c..3670c37 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -31,7 +31,6 @@
     name: "launcher-oop-tests-src",
     srcs: [
       "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
-      "src/com/android/launcher3/ui/ActivityLeakTracker.java",
       "src/com/android/launcher3/ui/PortraitLandscapeRunner.java",
       "src/com/android/launcher3/util/Wait.java",
       "src/com/android/launcher3/util/WidgetUtils.java",
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 1a6ce8c..b6b6cdd 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -36,7 +36,6 @@
 import android.os.Debug;
 import android.os.Process;
 import android.os.RemoteException;
-import android.os.StrictMode;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.util.Log;
@@ -99,11 +98,9 @@
     public static final long DEFAULT_UI_TIMEOUT = 10000;
     private static final String TAG = "AbstractLauncherUiTest";
 
-    private static String sStrictmodeDetectedActivityLeak;
     private static boolean sDumpWasGenerated = false;
-    private static boolean sActivityLeakReported;
+    private static boolean sActivityLeakReported = false;
     private static final String SYSTEMUI_PACKAGE = "com.android.systemui";
-    protected static final ActivityLeakTracker ACTIVITY_LEAK_TRACKER = new ActivityLeakTracker();
 
     protected LooperExecutor mMainThreadExecutor = MAIN_EXECUTOR;
     protected final UiDevice mDevice = UiDevice.getInstance(getInstrumentation());
@@ -112,45 +109,25 @@
     protected String mTargetPackage;
     private int mLauncherPid;
 
-    static {
-        if (TestHelpers.isInLauncherProcess()) {
-            StrictMode.VmPolicy.Builder builder =
-                    new StrictMode.VmPolicy.Builder()
-                            .penaltyLog()
-                            .penaltyListener(Runnable::run, violation -> {
-                                if (sStrictmodeDetectedActivityLeak == null) {
-                                    sStrictmodeDetectedActivityLeak = violation.toString() + ", "
-                                            + dumpHprofData() + ".";
-                                }
-                            });
-            StrictMode.setVmPolicy(builder.build());
-        }
-    }
-
     public static void checkDetectedLeaks(LauncherInstrumentation launcher) {
         if (sActivityLeakReported) return;
 
-        if (sStrictmodeDetectedActivityLeak != null) {
-            // Report from the test thread strictmode violations detected in the main thread.
-            sActivityLeakReported = true;
-            Assert.fail(sStrictmodeDetectedActivityLeak);
-        }
-
         // Check whether activity leak detector has found leaked activities.
-        Wait.atMost(AbstractLauncherUiTest::getActivityLeakErrorMessage,
+        Wait.atMost(() -> getActivityLeakErrorMessage(launcher),
                 () -> {
                     launcher.forceGc();
                     return MAIN_EXECUTOR.submit(
-                            () -> ACTIVITY_LEAK_TRACKER.noLeakedActivities()).get();
+                            () -> launcher.noLeakedActivities()).get();
                 }, DEFAULT_UI_TIMEOUT, launcher);
     }
 
-    private static String getActivityLeakErrorMessage() {
+    private static String getActivityLeakErrorMessage(LauncherInstrumentation launcher) {
         sActivityLeakReported = true;
-        return "Activity leak detector has found leaked activities, " + dumpHprofData() + ".";
+        return "Activity leak detector has found leaked activities, "
+                + dumpHprofData(launcher) + ".";
     }
 
-    public static String dumpHprofData() {
+    public static String dumpHprofData(LauncherInstrumentation launcher) {
         String result;
         if (sDumpWasGenerated) {
             Log.d("b/195319692", "dump has already been generated by another test",
@@ -176,8 +153,7 @@
                 result = "failed to save memory dump";
             }
         }
-        return result
-                + ". Full list of activities: " + ACTIVITY_LEAK_TRACKER.getActivitiesList();
+        return result + ". Full list of activities: " + launcher.getRootedActivitiesList();
     }
 
     protected AbstractLauncherUiTest() {
diff --git a/tests/src/com/android/launcher3/ui/ActivityLeakTracker.java b/tests/src/com/android/launcher3/ui/ActivityLeakTracker.java
deleted file mode 100644
index 2db7472..0000000
--- a/tests/src/com/android/launcher3/ui/ActivityLeakTracker.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.ui;
-
-import android.app.Activity;
-import android.app.Application;
-import android.os.Bundle;
-
-import androidx.test.InstrumentationRegistry;
-
-import com.android.launcher3.tapl.TestHelpers;
-
-import java.util.WeakHashMap;
-import java.util.stream.Collectors;
-
-public class ActivityLeakTracker implements Application.ActivityLifecycleCallbacks {
-    private final WeakHashMap<Activity, Boolean> mActivities = new WeakHashMap<>();
-
-    private int mActivitiesCreated;
-
-    ActivityLeakTracker() {
-        if (!TestHelpers.isInLauncherProcess()) return;
-        final Application app =
-                (Application) InstrumentationRegistry.getTargetContext().getApplicationContext();
-        app.registerActivityLifecycleCallbacks(this);
-    }
-
-    public int getActivitiesCreated() {
-        return mActivitiesCreated;
-    }
-
-    @Override
-    public void onActivityCreated(Activity activity, Bundle bundle) {
-        mActivities.put(activity, true);
-        ++mActivitiesCreated;
-    }
-
-    @Override
-    public void onActivityStarted(Activity activity) {
-    }
-
-    @Override
-    public void onActivityResumed(Activity activity) {
-    }
-
-    @Override
-    public void onActivityPaused(Activity activity) {
-    }
-
-    @Override
-    public void onActivityStopped(Activity activity) {
-    }
-
-    @Override
-    public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
-    }
-
-    @Override
-    public void onActivityDestroyed(Activity activity) {
-    }
-
-    public boolean noLeakedActivities() {
-        for (Activity activity : mActivities.keySet()) {
-            if (activity.isDestroyed()) {
-                return false;
-            }
-        }
-
-        return mActivities.size() <= 2;
-    }
-
-    public String getActivitiesList() {
-        return mActivities.keySet().stream().map(a -> a.getClass().getSimpleName())
-                .collect(Collectors.joining(","));
-    }
-}
diff --git a/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java b/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
index d6da776..715dcca 100644
--- a/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
+++ b/tests/src/com/android/launcher3/widget/picker/util/WidgetsTableUtilsTest.java
@@ -92,12 +92,13 @@
 
 
     @Test
-    public void groupWidgetItemsIntoTable_widgetsOnly_maxSpansPerRow5_shouldGroupWidgetsInTable() {
+    public void groupWidgetItemsIntoTableWithReordering_widgetsOnly_maxSpansPerRow5_shouldGroupWidgetsInTable() {
         List<WidgetItem> widgetItems = List.of(mWidget4x4, mWidget2x3, mWidget1x1, mWidget2x4,
                 mWidget2x2);
 
-        List<ArrayList<WidgetItem>> widgetItemInTable = WidgetsTableUtils.groupWidgetItemsIntoTable(
-                widgetItems, /* maxSpansPerRow= */ 5);
+        List<ArrayList<WidgetItem>> widgetItemInTable =
+                WidgetsTableUtils.groupWidgetItemsIntoTableWithReordering(
+                        widgetItems, /* maxSpansPerRow= */ 5);
 
         // Row 0: 1x1, 2x2
         // Row 1: 2x3, 2x4
@@ -109,12 +110,13 @@
     }
 
     @Test
-    public void groupWidgetItemsIntoTable_widgetsOnly_maxSpansPerRow4_shouldGroupWidgetsInTable() {
+    public void groupWidgetItemsIntoTableWithReordering_widgetsOnly_maxSpansPerRow4_shouldGroupWidgetsInTable() {
         List<WidgetItem> widgetItems = List.of(mWidget4x4, mWidget2x3, mWidget1x1, mWidget2x4,
                 mWidget2x2);
 
-        List<ArrayList<WidgetItem>> widgetItemInTable = WidgetsTableUtils.groupWidgetItemsIntoTable(
-                widgetItems, /* maxSpansPerRow= */ 4);
+        List<ArrayList<WidgetItem>> widgetItemInTable =
+                WidgetsTableUtils.groupWidgetItemsIntoTableWithReordering(
+                        widgetItems, /* maxSpansPerRow= */ 4);
 
         // Row 0: 1x1, 2x2
         // Row 1: 2x3,
@@ -128,12 +130,13 @@
     }
 
     @Test
-    public void groupWidgetItemsIntoTable_mixItems_maxSpansPerRow4_shouldGroupWidgetsInTable() {
+    public void groupWidgetItemsIntoTableWithReordering_mixItems_maxSpansPerRow4_shouldGroupWidgetsInTable() {
         List<WidgetItem> widgetItems = List.of(mWidget4x4, mShortcut3, mWidget2x3, mShortcut1,
                 mWidget1x1, mShortcut2, mWidget2x4, mWidget2x2);
 
-        List<ArrayList<WidgetItem>> widgetItemInTable = WidgetsTableUtils.groupWidgetItemsIntoTable(
-                widgetItems, /* maxSpansPerRow= */ 4);
+        List<ArrayList<WidgetItem>> widgetItemInTable =
+                WidgetsTableUtils.groupWidgetItemsIntoTableWithReordering(
+                        widgetItems, /* maxSpansPerRow= */ 4);
 
         // Row 0: 1x1, 2x2
         // Row 1: 2x3,
@@ -148,6 +151,24 @@
         assertThat(widgetItemInTable.get(4)).containsExactly(mShortcut3, mShortcut2, mShortcut1);
     }
 
+    @Test
+    public void groupWidgetItemsIntoTableWithoutReordering_shouldMaintainTheOrder() {
+        List<WidgetItem> widgetItems =
+                List.of(mWidget4x4, mWidget2x3, mWidget1x1, mWidget2x4, mWidget2x2);
+
+        List<ArrayList<WidgetItem>> widgetItemInTable =
+                WidgetsTableUtils.groupWidgetItemsIntoTableWithoutReordering(
+                        widgetItems, /* maxSpansPerRow= */ 5);
+
+        // Row 0: 4x4
+        // Row 1: 2x3, 1x1
+        // Row 2: 2x4, 2x2
+        assertThat(widgetItemInTable).hasSize(3);
+        assertThat(widgetItemInTable.get(0)).containsExactly(mWidget4x4);
+        assertThat(widgetItemInTable.get(1)).containsExactly(mWidget2x3, mWidget1x1);
+        assertThat(widgetItemInTable.get(2)).containsExactly(mWidget2x4, mWidget2x2);
+    }
+
     private void initTestWidgets() {
         List<Point> widgetSizes = List.of(new Point(1, 1), new Point(2, 2), new Point(2, 3),
                 new Point(2, 4), new Point(4, 4));
diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
index 588b6b8..7137c00 100644
--- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
+++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
@@ -35,6 +35,7 @@
     BaseOverview(LauncherInstrumentation launcher) {
         super(launcher);
         verifyActiveContainer();
+        verifyActionsViewVisibility();
     }
 
     @Override
@@ -59,7 +60,11 @@
             final int leftMargin = mLauncher.getTargetInsets().left;
             mLauncher.scroll(
                     overview, Direction.LEFT, new Rect(leftMargin + 1, 0, 0, 0), 20, false);
-            verifyActiveContainer();
+            try (LauncherInstrumentation.Closable c2 =
+                         mLauncher.addContextLayer("flung forwards")) {
+                verifyActiveContainer();
+                verifyActionsViewVisibility();
+            }
         }
     }
 
@@ -95,7 +100,11 @@
             final int rightMargin = mLauncher.getTargetInsets().right;
             mLauncher.scroll(
                     overview, Direction.RIGHT, new Rect(0, 0, rightMargin + 1, 0), 20, false);
-            verifyActiveContainer();
+            try (LauncherInstrumentation.Closable c2 =
+                         mLauncher.addContextLayer("flung backwards")) {
+                verifyActiveContainer();
+                verifyActionsViewVisibility();
+            }
         }
     }
 
@@ -150,4 +159,55 @@
             return new OverviewActions(overviewActions, mLauncher);
         }
     }
+
+    /* TODO(b/197630182): Once b/188790554 is fixed, remove instanceof check. Currently, when
+        swiping from app to overview in Fallback Recents, taskbar remains and no action buttons
+        are visible, so we are only testing Overview for now, not BaseOverview. */
+    private void verifyActionsViewVisibility() {
+        if (!(this instanceof Overview)) {
+            return;
+        }
+        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+                "want to assert overview actions view visibility")) {
+            if (mLauncher.isTablet() && !isOverviewSnappedToFocusedTask()) {
+                mLauncher.waitUntilLauncherObjectGone("action_buttons");
+            } else {
+                mLauncher.waitForLauncherObject("action_buttons");
+            }
+        }
+    }
+
+    /**
+     * Returns if focused task is currently snapped task in overview.
+     */
+    private boolean isOverviewSnappedToFocusedTask() {
+        if (!mLauncher.isTablet()) {
+            // Focused task only exists in tablet's grid-overview
+            return false;
+        }
+        UiObject2 focusedTask = getFocusedTask();
+        if (focusedTask == null) {
+            return false;
+        }
+        return Math.abs(
+                focusedTask.getVisibleBounds().exactCenterX() - mLauncher.getExactScreenCenterX())
+                < 1;
+    }
+
+    /**
+     * Returns Overview focused task if it exists.
+     */
+    private UiObject2 getFocusedTask() {
+        final List<UiObject2> taskViews = getTasks();
+        if (taskViews.size() == 0) {
+            return null;
+        }
+        int focusedTaskWidth = mLauncher.getFocusedTaskWidth();
+        for (UiObject2 task : taskViews) {
+            if (task.getVisibleBounds().width() == focusedTaskWidth) {
+                return task;
+            }
+        }
+        return null;
+    }
 }
\ No newline at end of file
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index f7c6044..3e73c12 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -321,6 +321,15 @@
                 .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD);
     }
 
+    int getFocusedTaskWidth() {
+        return getTestInfo(TestProtocol.REQUEST_GET_FOCUSED_TASK_WIDTH_FOR_TABLET).getInt(
+                TestProtocol.TEST_INFO_RESPONSE_FIELD);
+    }
+
+    float getExactScreenCenterX() {
+        return getRealDisplaySize().x / 2f;
+    }
+
     private void setForcePauseTimeout(long timeout) {
         getTestInfo(TestProtocol.REQUEST_SET_FORCE_PAUSE_TIMEOUT, Long.toString(timeout));
     }
@@ -1460,11 +1469,6 @@
                 TestProtocol.TEST_INFO_RESPONSE_FIELD);
     }
 
-    boolean overviewContentPushEnabled() {
-        return getTestInfo(TestProtocol.REQUEST_OVERVIEW_CONTENT_PUSH_ENABLED).getBoolean(
-                TestProtocol.TEST_INFO_RESPONSE_FIELD);
-    }
-
     private void disableSensorRotation() {
         getTestInfo(TestProtocol.REQUEST_MOCK_SENSOR_ROTATION);
     }
@@ -1502,6 +1506,30 @@
         getTestInfo(TestProtocol.REQUEST_CLEAR_DATA);
     }
 
+    private String[] getActivities() {
+        return getTestInfo(TestProtocol.REQUEST_GET_ACTIVITIES)
+                .getStringArray(TestProtocol.TEST_INFO_RESPONSE_FIELD);
+    }
+
+    public String getRootedActivitiesList() {
+        return String.join(", ", getActivities());
+    }
+
+    public boolean noLeakedActivities() {
+        final String[] activities = getActivities();
+        for (String activity : activities) {
+            if (activity.contains("(destroyed)")) {
+                return false;
+            }
+        }
+        return activities.length <= 2;
+    }
+
+    public int getActivitiesCreated() {
+        return getTestInfo(TestProtocol.REQUEST_GET_ACTIVITIES_CREATED_COUNT)
+                .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD);
+    }
+
     public Closable eventsCheck() {
         Assert.assertTrue("Nested event checking", mEventChecker == null);
         disableSensorRotation();
diff --git a/tests/tapl/com/android/launcher3/tapl/Overview.java b/tests/tapl/com/android/launcher3/tapl/Overview.java
index 4d673a8..0d06be3 100644
--- a/tests/tapl/com/android/launcher3/tapl/Overview.java
+++ b/tests/tapl/com/android/launcher3/tapl/Overview.java
@@ -30,7 +30,6 @@
 
     Overview(LauncherInstrumentation launcher) {
         super(launcher);
-        verifyActiveContainer();
     }
 
     @Override
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
index 950c052..aa4cc4c 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
@@ -34,27 +34,6 @@
     }
 
     /**
-     * Clicks content push button.
-     */
-    @NonNull
-    public Overview clickAndDismissContentPush() {
-        if (mLauncher.overviewContentPushEnabled()) {
-            try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
-                 LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
-                         "want to click content push button and exit screenshot ui")) {
-                UiObject2 exo = mLauncher.waitForObjectInContainer(mOverviewActions,
-                        "action_content_push");
-                mLauncher.clickLauncherObject(exo);
-                try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
-                        "clicked content push button")) {
-                    return new Overview(mLauncher);
-                }
-            }
-        }
-        return new Overview(mLauncher);
-    }
-
-    /**
      * Clicks screenshot button and closes screenshot ui.
      */
     @NonNull