Move split functions from RecentsView to SplitSelectStateController

* Moving things out of RecentsView to avoid
dependency on a non-testable class
* Also helping prevent bloating RecentsView.java

Bug: 266482558
Test: Single Chrome instance in recents. Initiate split
with Chrome from workspace, tap on Chrome again in Taskbar,
ensure no crash.

Change-Id: I99ec704479ffaa860f4d80c2cb9f54182f31f41a
This commit is contained in:
Vinit Nayak
2023-02-16 17:43:32 -08:00
parent a75105ef03
commit c97bb4600f
5 changed files with 68 additions and 69 deletions

View File

@@ -870,9 +870,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
* (potentially breaking a split pair).
*/
private void launchFromTaskbarPreservingSplitIfVisible(RecentsView recents, ItemInfo info) {
recents.findLastActiveTaskAndRunCallback(
recents.getSplitSelectController().findLastActiveTaskAndRunCallback(
info.getTargetComponent(),
(Consumer<Task>) foundTask -> {
foundTask -> {
if (foundTask != null) {
TaskView foundTaskView =
recents.getTaskViewByTaskId(foundTask.key.id);