Remove legacy callbacks between recents and split screen

Removes legacy recents callbacks between recents and split screen since
there's no need to interact with RecentsActivityStartingEvent and
RecentGrowingEvent after deprecated legacy recents implmentaton.

Bug: 161116823
Test: atest SystemUITests
Test: manual check recents behavior while in split screen mode
Change-Id: Iee1546d41ae2b1a8e4162cbb2fa599162a5b308f
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 2ad0cab..fa620df 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -161,10 +161,6 @@
     <!-- The number of milliseconds to extend ambient pulse by when prompted (e.g. on touch) -->
     <integer name="ambient_notification_extension_time">10000</integer>
 
-    <!-- In multi-window, determines whether the stack where recents lives should grow from
-         the smallest position when being launched. -->
-    <bool name="recents_grow_in_multiwindow">true</bool>
-
     <!-- Animation duration when using long press on recents to dock -->
     <integer name="long_press_dock_anim_duration">250</integer>
 
diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java
index 5f37cc45..df61fd1 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java
@@ -65,10 +65,6 @@
         }
     }
 
-    public void growRecents() {
-        mImpl.growRecents();
-    }
-
     @Override
     public void showRecentApps(boolean triggeredFromAltTab) {
         // Ensure the device has been provisioned before allowing the user to interact with
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java b/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java
index 5301bbd..4007abb 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java
@@ -23,20 +23,16 @@
 import android.window.WindowContainerToken;
 
 import com.android.systemui.SystemUI;
-import com.android.systemui.recents.Recents;
 import com.android.systemui.shared.system.ActivityManagerWrapper;
 import com.android.systemui.shared.system.TaskStackChangeListener;
 import com.android.systemui.statusbar.policy.KeyguardStateController;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
-import java.util.Optional;
 import java.util.function.Consumer;
 
 import javax.inject.Singleton;
 
-import dagger.Lazy;
-
 /**
  * Controls the docked stack divider.
  */
@@ -44,15 +40,12 @@
 public class Divider extends SystemUI {
     private final KeyguardStateController mKeyguardStateController;
     private final DividerController mDividerController;
-    private final Optional<Lazy<Recents>> mRecentsOptionalLazy;
 
     Divider(Context context, DividerController dividerController,
-            KeyguardStateController keyguardStateController,
-            Optional<Lazy<Recents>> recentsOptionalLazy) {
+            KeyguardStateController keyguardStateController) {
         super(context);
         mDividerController = dividerController;
         mKeyguardStateController = keyguardStateController;
-        mRecentsOptionalLazy = recentsOptionalLazy;
     }
 
     @Override
@@ -113,8 +106,7 @@
     }
 
     public void onRecentsDrawn() {
-        mDividerController.onRecentsDrawn(() -> mRecentsOptionalLazy.ifPresent(
-                recentsLazy -> recentsLazy.get().growRecents()));
+        mDividerController.onRecentsDrawn();
     }
 
     public void onDockedFirstAnimationFrame() {
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerController.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerController.java
index 14fc157..81649f6 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerController.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerController.java
@@ -391,9 +391,9 @@
      * subscriber, or DividerView, which has been removed and prevented from resizing. Instead,
      * register the event handler here and proxy the event to the current DividerView.
      */
-    public void onRecentsDrawn(DividerView.RecentDrawnCallback callback) {
+    public void onRecentsDrawn() {
         if (mView != null) {
-            mView.onRecentsDrawn(callback);
+            mView.onRecentsDrawn();
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerModule.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerModule.java
index cdf44d7..db0aef8 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerModule.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerModule.java
@@ -20,18 +20,14 @@
 import android.os.Handler;
 
 import com.android.systemui.dagger.qualifiers.Main;
-import com.android.systemui.recents.Recents;
 import com.android.systemui.statusbar.policy.KeyguardStateController;
 import com.android.wm.shell.common.DisplayController;
 import com.android.wm.shell.common.DisplayImeController;
 import com.android.wm.shell.common.SystemWindows;
 import com.android.wm.shell.common.TransactionPool;
 
-import java.util.Optional;
-
 import javax.inject.Singleton;
 
-import dagger.Lazy;
 import dagger.Module;
 import dagger.Provides;
 
@@ -42,14 +38,12 @@
 public class DividerModule {
     @Singleton
     @Provides
-    static Divider provideDivider(Context context, Optional<Lazy<Recents>> recentsOptionalLazy,
-            DisplayController displayController, SystemWindows systemWindows,
-            DisplayImeController imeController, @Main Handler handler,
+    static Divider provideDivider(Context context, DisplayController displayController,
+            SystemWindows systemWindows, DisplayImeController imeController, @Main Handler handler,
             KeyguardStateController keyguardStateController, TransactionPool transactionPool) {
         // TODO(b/161116823): fetch DividerProxy from WM shell lib.
         DividerController dividerController = new DividerController(context, displayController,
                 systemWindows, imeController, handler, transactionPool);
-        return new Divider(context, dividerController, keyguardStateController,
-                recentsOptionalLazy);
+        return new Divider(context, dividerController, keyguardStateController);
     }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerState.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerState.java
index 3a5c61e..8e79d51 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerState.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerState.java
@@ -21,6 +21,5 @@
  */
 public class DividerState {
     public boolean animateAfterRecentsDrawn;
-    public boolean growAfterRecentsDrawn;
     public float mRatioPositionBeforeMinimized;
 }
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
index 6447c52..e5c02d6 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
@@ -83,10 +83,6 @@
         void onDraggingEnd();
     }
 
-    interface RecentDrawnCallback {
-        void growRecents();
-    }
-
     static final long TOUCH_ANIMATION_DURATION = 150;
     static final long TOUCH_RELEASE_ANIMATION_DURATION = 200;
 
@@ -151,7 +147,6 @@
     private DividerCallbacks mCallback;
     private final AnimationHandler mAnimationHandler = new AnimationHandler();
 
-    private boolean mGrowRecents;
     private ValueAnimator mCurrentAnimator;
     private boolean mEntranceAnimationRunning;
     private boolean mExitAnimationRunning;
@@ -307,7 +302,6 @@
                 R.dimen.docked_stack_divider_lift_elevation);
         mLongPressEntraceAnimDuration = getResources().getInteger(
                 R.integer.long_press_dock_anim_duration);
-        mGrowRecents = getResources().getBoolean(R.bool.recents_grow_in_multiwindow);
         mTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
         mFlingAnimationUtils = new FlingAnimationUtils(getResources().getDisplayMetrics(), 0.3f);
         boolean landscape = getResources().getConfiguration().orientation
@@ -1322,39 +1316,11 @@
                 mBackground.getRight(), mBackground.getBottom(), Op.UNION);
     }
 
-    /**
-     * Checks whether recents will grow when invoked. This happens in multi-window when recents is
-     * very small. When invoking recents, we shrink the docked stack so recents has more space.
-     *
-     * @return the position of the divider when recents grows, or
-     *         {@link #INVALID_RECENTS_GROW_TARGET} if recents won't grow
-     */
-    public int growsRecents() {
-        boolean result = mGrowRecents
-                && mDockSide == WindowManager.DOCKED_TOP
-                && getCurrentPosition() == getSnapAlgorithm().getLastSplitTarget().position;
-        if (result) {
-            return getSnapAlgorithm().getMiddleTarget().position;
-        } else {
-            return INVALID_RECENTS_GROW_TARGET;
-        }
-    }
-
-    void onRecentsActivityStarting() {
-        if (mGrowRecents && mDockSide == WindowManager.DOCKED_TOP
-                && getSnapAlgorithm().getMiddleTarget() != getSnapAlgorithm().getLastSplitTarget()
-                && getCurrentPosition() == getSnapAlgorithm().getLastSplitTarget().position) {
-            mState.growAfterRecentsDrawn = true;
-            startDragging(false /* animate */, false /* touching */);
-        }
-    }
-
     void onDockedFirstAnimationFrame() {
         saveSnapTargetBeforeMinimized(mSplitLayout.getSnapAlgorithm().getMiddleTarget());
     }
 
     void onDockedTopTask() {
-        mState.growAfterRecentsDrawn = false;
         mState.animateAfterRecentsDrawn = true;
         startDragging(false /* animate */, false /* touching */);
         updateDockSide();
@@ -1366,7 +1332,7 @@
                 null /* transaction */);
     }
 
-    void onRecentsDrawn(RecentDrawnCallback callback) {
+    void onRecentsDrawn() {
         updateDockSide();
         final int position = calculatePositionForInsetBounds();
         if (mState.animateAfterRecentsDrawn) {
@@ -1380,15 +1346,6 @@
                         200 /* endDelay */);
             });
         }
-        if (mState.growAfterRecentsDrawn) {
-            mState.growAfterRecentsDrawn = false;
-            updateDockSide();
-            if (callback != null) {
-                callback.growRecents();
-            }
-            stopDragging(position, getSnapAlgorithm().getMiddleTarget(), 336,
-                    Interpolators.FAST_OUT_SLOW_IN);
-        }
     }
 
     void onUndockingTask() {