Pass OverviewComponentObserver as a parameter.

Instead of instantiating a new OVerviewComponentObserver, instantiate
one in QuickstepLauncher and pass it down to relevant classes.

Test: Manual
Bug: 336155199
Flag: ACONFIG com.android.window.flags.enable_desktop_windowing_mode DEVELOPMENT
Change-Id: Ifcc40c63f0649544a92e7f6d4a00d9edcd9f7fe1
This commit is contained in:
Orhan Uysal
2024-04-29 15:31:44 +00:00
parent 1ebeb1d1ae
commit 6d54305170
4 changed files with 26 additions and 14 deletions
@@ -166,6 +166,8 @@ import com.android.launcher3.util.StartActivityParams;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.widget.LauncherWidgetHolder;
import com.android.quickstep.OverviewCommandHelper;
import com.android.quickstep.OverviewComponentObserver;
import com.android.quickstep.RecentsAnimationDeviceState;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
@@ -264,6 +266,10 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer
getDepthController(), getStatsLogManager(),
systemUiProxy, RecentsModel.INSTANCE.get(this),
() -> onStateBack());
RecentsAnimationDeviceState deviceState = new RecentsAnimationDeviceState(asContext());
// TODO(b/337863494): Explore use of the same OverviewComponentObserver across launcher
OverviewComponentObserver overviewComponentObserver = new OverviewComponentObserver(
asContext(), deviceState);
if (enableDesktopWindowingMode()) {
mDesktopRecentsTransitionController = new DesktopRecentsTransitionController(
getStateManager(), systemUiProxy, getIApplicationThread(),
@@ -272,7 +278,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer
overviewPanel.init(mActionsView, mSplitSelectStateController,
mDesktopRecentsTransitionController);
mSplitWithKeyboardShortcutController = new SplitWithKeyboardShortcutController(this,
mSplitSelectStateController);
mSplitSelectStateController, overviewComponentObserver, deviceState);
mSplitToWorkspaceController = new SplitToWorkspaceController(this,
mSplitSelectStateController);
mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize());
@@ -287,7 +293,8 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer
if (enableDesktopWindowingMode()) {
mDesktopVisibilityController = new DesktopVisibilityController(this);
mDesktopVisibilityController.registerSystemUiListener();
mSplitSelectStateController.initSplitFromDesktopController(this);
mSplitSelectStateController.initSplitFromDesktopController(this,
overviewComponentObserver);
}
mHotseatPredictionController = new HotseatPredictionController(this);