mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Support multiple tasks per split screen via SplitRemoteTargetHandles
It enables support for assigning SplitRemoteTargetHandles to multiple tasks within a split-screen. The changes include: - Retrieving the list of split-screen tasks directly from `SplitBounds`. - Iterating through the task list and setting the remoteTargetHandle for each individual task. - General code refactoring to set the remoteTargetHandle. Bug: 346295292 Bug: 360782849 Flag: com.android.wm.shell.enable_flexible_two_app_split Test: manual test. Video: Before: http://recall/-/gvQq7Z7JECwxnxKrBmr3wt/fnHVbaVwMWfvrOaez5eO6L Video: After: http://recall/-/gvQq7Z7JECwxnxKrBmr3wt/dzv6tZMlAYG1bBBtYdsWxF Change-Id: I1e8c8316947b0d4fd72c9cf36dff8ecd99d2f170
This commit is contained in:
@@ -132,6 +132,42 @@ public abstract class AbsSwipeUpHandlerTestCase<
|
||||
/* taskInfo= */ mRunningTaskInfo,
|
||||
/* allowEnterPip= */ false);
|
||||
|
||||
protected final RemoteAnimationTarget mRemoteAnimationLeftTop = new RemoteAnimationTarget(
|
||||
/* taskId= */ 1,
|
||||
/* mode= */ RemoteAnimationTarget.MODE_CLOSING,
|
||||
/* leash= */ new SurfaceControl(),
|
||||
/* isTranslucent= */ false,
|
||||
/* clipRect= */ null,
|
||||
/* contentInsets= */ null,
|
||||
/* prefixOrderIndex= */ 0,
|
||||
/* position= */ null,
|
||||
/* localBounds= */ null,
|
||||
/* screenSpaceBounds= */ null,
|
||||
new Configuration().windowConfiguration,
|
||||
/* isNotInRecents= */ false,
|
||||
/* startLeash= */ null,
|
||||
/* startBounds= */ null,
|
||||
/* taskInfo= */ mRunningTaskInfo,
|
||||
/* allowEnterPip= */ false);
|
||||
|
||||
protected final RemoteAnimationTarget mRemoteAnimationRightBottom = new RemoteAnimationTarget(
|
||||
/* taskId= */ 2,
|
||||
/* mode= */ RemoteAnimationTarget.MODE_CLOSING,
|
||||
/* leash= */ new SurfaceControl(),
|
||||
/* isTranslucent= */ false,
|
||||
/* clipRect= */ null,
|
||||
/* contentInsets= */ null,
|
||||
/* prefixOrderIndex= */ 0,
|
||||
/* position= */ null,
|
||||
/* localBounds= */ null,
|
||||
/* screenSpaceBounds= */ null,
|
||||
new Configuration().windowConfiguration,
|
||||
/* isNotInRecents= */ false,
|
||||
/* startLeash= */ null,
|
||||
/* startBounds= */ null,
|
||||
/* taskInfo= */ mRunningTaskInfo,
|
||||
/* allowEnterPip= */ false);
|
||||
|
||||
protected RecentsAnimationTargets mRecentsAnimationTargets;
|
||||
protected TaskAnimationManager mTaskAnimationManager;
|
||||
protected StateManager<STATE_TYPE, RECENTS_CONTAINER> mStateManager;
|
||||
@@ -157,12 +193,12 @@ public abstract class AbsSwipeUpHandlerTestCase<
|
||||
extras.putParcelable(KEY_EXTRA_SPLIT_BOUNDS, new SplitBounds(
|
||||
/* leftTopBounds = */ new Rect(),
|
||||
/* rightBottomBounds = */ new Rect(),
|
||||
/* leftTopTaskId = */ -1,
|
||||
/* rightBottomTaskId = */ -1,
|
||||
/* leftTopTaskId = */ mRemoteAnimationLeftTop.taskId,
|
||||
/* rightBottomTaskId = */ mRemoteAnimationRightBottom.taskId,
|
||||
/* snapPosition = */ SNAP_TO_2_50_50));
|
||||
mRecentsAnimationTargets = new RecentsAnimationTargets(
|
||||
new RemoteAnimationTarget[] {mRemoteAnimationTarget},
|
||||
new RemoteAnimationTarget[] {mRemoteAnimationTarget},
|
||||
new RemoteAnimationTarget[] {mRemoteAnimationLeftTop},
|
||||
new RemoteAnimationTarget[] {mRemoteAnimationRightBottom},
|
||||
new RemoteAnimationTarget[] {mRemoteAnimationTarget},
|
||||
/* homeContentInsets= */ new Rect(),
|
||||
/* minimizedHomeBounds= */ null,
|
||||
|
||||
@@ -121,8 +121,8 @@ public class RecentTasksListTest {
|
||||
new RecentTaskInfo(), new RecentTaskInfo(), new SplitBounds(
|
||||
/* leftTopBounds = */ new Rect(),
|
||||
/* rightBottomBounds = */ new Rect(),
|
||||
/* leftTopTaskId = */ -1,
|
||||
/* rightBottomTaskId = */ -1,
|
||||
/* leftTopTaskId = */ 1,
|
||||
/* rightBottomTaskId = */ 2,
|
||||
/* snapPosition = */ SplitScreenConstants.SNAP_TO_2_50_50));
|
||||
when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
|
||||
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
|
||||
@@ -217,8 +217,8 @@ public class RecentTasksListTest {
|
||||
new SplitBounds(
|
||||
/* leftTopBounds = */ new Rect(),
|
||||
/* rightBottomBounds = */ new Rect(),
|
||||
/* leftTopTaskId = */ -1,
|
||||
/* rightBottomTaskId = */ -1,
|
||||
/* leftTopTaskId = */ 1,
|
||||
/* rightBottomTaskId = */ 2,
|
||||
/* snapPosition = */ SplitScreenConstants.SNAP_TO_2_50_50));
|
||||
when(mSystemUiProxy.getRecentTasks(anyInt(), anyInt()))
|
||||
.thenReturn(new ArrayList<>(Collections.singletonList(recentTaskInfos)));
|
||||
|
||||
@@ -247,8 +247,8 @@ public class RecentsModelTest {
|
||||
new SplitTask(task1, task2, new SplitBounds(
|
||||
/* leftTopBounds = */ new Rect(),
|
||||
/* rightBottomBounds = */ new Rect(),
|
||||
/* leftTopTaskId = */ -1,
|
||||
/* rightBottomTaskId = */ -1,
|
||||
/* leftTopTaskId = */ 1,
|
||||
/* rightBottomTaskId = */ 2,
|
||||
/* snapPosition = */ SplitScreenConstants.SNAP_TO_2_50_50)));
|
||||
return allTasks;
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ class TasksRepositoryTest {
|
||||
SplitBounds(
|
||||
/* leftTopBounds = */ Rect(),
|
||||
/* rightBottomBounds = */ Rect(),
|
||||
/* leftTopTaskId = */ -1,
|
||||
/* rightBottomTaskId = */ -1,
|
||||
/* leftTopTaskId = */ 1,
|
||||
/* rightBottomTaskId = */ 2,
|
||||
/* snapPosition = */ SNAP_TO_2_50_50,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user