Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +5 −0 Original line number Diff line number Diff line Loading @@ -431,6 +431,11 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { " adding opening taskId=%d", taskInfo.taskId); mOpeningTasks.add(new TaskState(change, target.leash)); } } else if (TransitionUtil.isDividerBar(change)) { final RemoteAnimationTarget target = TransitionUtil.newTarget(change, info.getChanges().size() - i, info, t, mLeashMap); // Add this as a app and we will separate them on launcher side by window type. apps.add(target); } } t.apply(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +3 −2 Original line number Diff line number Diff line Loading @@ -2788,8 +2788,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } /** Call this when starting the open-recents animation while split-screen is active. */ public void onRecentsInSplitAnimationStart(@NonNull SurfaceControl.Transaction t) { setDividerVisibility(false, t); public void onRecentsInSplitAnimationStart(TransitionInfo info) { addDividerBarToTransition(info, false /* show */); } /** Call this when the recents animation during split-screen finishes. */ Loading @@ -2806,6 +2806,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, || mSideStage.containsContainer(container))) { updateSurfaceBounds(mSplitLayout, finishT, false /* applyResizingOffset */); finishT.reparent(mSplitLayout.getDividerLeash(), mRootTaskLeash); setDividerVisibility(true, finishT); return; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -524,7 +524,7 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler, finishCallback.onTransitionFinished(wct, wctCB); }; mixed.mInFlightSubAnimations = 1; mSplitHandler.onRecentsInSplitAnimationStart(startTransaction); mSplitHandler.onRecentsInSplitAnimationStart(info); final boolean handled = mixed.mLeftoversHandler.startAnimation(mixed.mTransition, info, startTransaction, finishTransaction, finishCB); if (!handled) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/util/TransitionUtil.java +29 −2 Original line number Diff line number Diff line Loading @@ -110,6 +110,11 @@ public class TransitionUtil { && !change.hasFlags(FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY); } /** Returns `true` if `change` is the divider. */ public static boolean isDividerBar(TransitionInfo.Change change) { return isNonApp(change) && change.hasFlags(FLAG_IS_DIVIDER_BAR); } /** Returns `true` if `change` is only re-ordering. */ public static boolean isOrderOnly(TransitionInfo.Change change) { return change.getMode() == TRANSIT_CHANGE Loading Loading @@ -175,6 +180,14 @@ public class TransitionUtil { t.setPosition(leash, absBounds.left - info.getRoot(rootIdx).getOffset().x, absBounds.top - info.getRoot(rootIdx).getOffset().y); if (isDividerBar(change)) { if (isOpeningType(mode)) { t.setAlpha(leash, 0.f); } t.setLayer(leash, Integer.MAX_VALUE); return; } // Put all the OPEN/SHOW on top if (TransitionUtil.isOpeningType(mode)) { if (isOpening) { Loading Loading @@ -245,6 +258,10 @@ public class TransitionUtil { */ public static RemoteAnimationTarget newTarget(TransitionInfo.Change change, int order, SurfaceControl leash) { if (isDividerBar(change)) { return getDividerTarget(change, leash); } int taskId; boolean isNotInRecents; ActivityManager.RunningTaskInfo taskInfo; Loading Loading @@ -284,8 +301,7 @@ public class TransitionUtil { new Rect(change.getStartAbsBounds()), taskInfo, change.getAllowEnterPip(), (change.getFlags() & FLAG_IS_DIVIDER_BAR) != 0 ? TYPE_DOCK_DIVIDER : INVALID_WINDOW_TYPE INVALID_WINDOW_TYPE ); target.setWillShowImeOnTarget( (change.getFlags() & TransitionInfo.FLAG_WILL_IME_SHOWN) != 0); Loading @@ -293,6 +309,17 @@ public class TransitionUtil { return target; } private static RemoteAnimationTarget getDividerTarget(TransitionInfo.Change change, SurfaceControl leash) { return new RemoteAnimationTarget(-1 /* taskId */, -1 /* mode */, leash, false /* isTranslucent */, null /* clipRect */, null /* contentInsets */, Integer.MAX_VALUE /* prefixOrderIndex */, new android.graphics.Point(0, 0) /* position */, change.getStartAbsBounds(), change.getStartAbsBounds(), new WindowConfiguration(), true, null /* startLeash */, null /* startBounds */, null /* taskInfo */, false /* allowEnterPip */, TYPE_DOCK_DIVIDER); } /** * Finds the "correct" root idx for a change. The change's end display is prioritized, then * the start display. If there is no display, it will fallback on the 0th root in the Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTransitionTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -273,7 +273,7 @@ public class SplitTransitionTests extends ShellTestCase { // simulate the start of recents transition mMainStage.onTaskVanished(mMainChild); mSideStage.onTaskVanished(mSideChild); mStageCoordinator.onRecentsInSplitAnimationStart(mock(SurfaceControl.Transaction.class)); mStageCoordinator.onRecentsInSplitAnimationStart(mock(TransitionInfo.class)); assertTrue(mStageCoordinator.isSplitScreenVisible()); // Make sure it cleans-up if recents doesn't restore Loading Loading @@ -307,7 +307,7 @@ public class SplitTransitionTests extends ShellTestCase { // simulate the start of recents transition mMainStage.onTaskVanished(mMainChild); mSideStage.onTaskVanished(mSideChild); mStageCoordinator.onRecentsInSplitAnimationStart(mock(SurfaceControl.Transaction.class)); mStageCoordinator.onRecentsInSplitAnimationStart(mock(TransitionInfo.class)); assertTrue(mStageCoordinator.isSplitScreenVisible()); // Make sure we remain in split after recents restores. Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +5 −0 Original line number Diff line number Diff line Loading @@ -431,6 +431,11 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { " adding opening taskId=%d", taskInfo.taskId); mOpeningTasks.add(new TaskState(change, target.leash)); } } else if (TransitionUtil.isDividerBar(change)) { final RemoteAnimationTarget target = TransitionUtil.newTarget(change, info.getChanges().size() - i, info, t, mLeashMap); // Add this as a app and we will separate them on launcher side by window type. apps.add(target); } } t.apply(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +3 −2 Original line number Diff line number Diff line Loading @@ -2788,8 +2788,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } /** Call this when starting the open-recents animation while split-screen is active. */ public void onRecentsInSplitAnimationStart(@NonNull SurfaceControl.Transaction t) { setDividerVisibility(false, t); public void onRecentsInSplitAnimationStart(TransitionInfo info) { addDividerBarToTransition(info, false /* show */); } /** Call this when the recents animation during split-screen finishes. */ Loading @@ -2806,6 +2806,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, || mSideStage.containsContainer(container))) { updateSurfaceBounds(mSplitLayout, finishT, false /* applyResizingOffset */); finishT.reparent(mSplitLayout.getDividerLeash(), mRootTaskLeash); setDividerVisibility(true, finishT); return; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -524,7 +524,7 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler, finishCallback.onTransitionFinished(wct, wctCB); }; mixed.mInFlightSubAnimations = 1; mSplitHandler.onRecentsInSplitAnimationStart(startTransaction); mSplitHandler.onRecentsInSplitAnimationStart(info); final boolean handled = mixed.mLeftoversHandler.startAnimation(mixed.mTransition, info, startTransaction, finishTransaction, finishCB); if (!handled) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/util/TransitionUtil.java +29 −2 Original line number Diff line number Diff line Loading @@ -110,6 +110,11 @@ public class TransitionUtil { && !change.hasFlags(FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY); } /** Returns `true` if `change` is the divider. */ public static boolean isDividerBar(TransitionInfo.Change change) { return isNonApp(change) && change.hasFlags(FLAG_IS_DIVIDER_BAR); } /** Returns `true` if `change` is only re-ordering. */ public static boolean isOrderOnly(TransitionInfo.Change change) { return change.getMode() == TRANSIT_CHANGE Loading Loading @@ -175,6 +180,14 @@ public class TransitionUtil { t.setPosition(leash, absBounds.left - info.getRoot(rootIdx).getOffset().x, absBounds.top - info.getRoot(rootIdx).getOffset().y); if (isDividerBar(change)) { if (isOpeningType(mode)) { t.setAlpha(leash, 0.f); } t.setLayer(leash, Integer.MAX_VALUE); return; } // Put all the OPEN/SHOW on top if (TransitionUtil.isOpeningType(mode)) { if (isOpening) { Loading Loading @@ -245,6 +258,10 @@ public class TransitionUtil { */ public static RemoteAnimationTarget newTarget(TransitionInfo.Change change, int order, SurfaceControl leash) { if (isDividerBar(change)) { return getDividerTarget(change, leash); } int taskId; boolean isNotInRecents; ActivityManager.RunningTaskInfo taskInfo; Loading Loading @@ -284,8 +301,7 @@ public class TransitionUtil { new Rect(change.getStartAbsBounds()), taskInfo, change.getAllowEnterPip(), (change.getFlags() & FLAG_IS_DIVIDER_BAR) != 0 ? TYPE_DOCK_DIVIDER : INVALID_WINDOW_TYPE INVALID_WINDOW_TYPE ); target.setWillShowImeOnTarget( (change.getFlags() & TransitionInfo.FLAG_WILL_IME_SHOWN) != 0); Loading @@ -293,6 +309,17 @@ public class TransitionUtil { return target; } private static RemoteAnimationTarget getDividerTarget(TransitionInfo.Change change, SurfaceControl leash) { return new RemoteAnimationTarget(-1 /* taskId */, -1 /* mode */, leash, false /* isTranslucent */, null /* clipRect */, null /* contentInsets */, Integer.MAX_VALUE /* prefixOrderIndex */, new android.graphics.Point(0, 0) /* position */, change.getStartAbsBounds(), change.getStartAbsBounds(), new WindowConfiguration(), true, null /* startLeash */, null /* startBounds */, null /* taskInfo */, false /* allowEnterPip */, TYPE_DOCK_DIVIDER); } /** * Finds the "correct" root idx for a change. The change's end display is prioritized, then * the start display. If there is no display, it will fallback on the 0th root in the Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/SplitTransitionTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -273,7 +273,7 @@ public class SplitTransitionTests extends ShellTestCase { // simulate the start of recents transition mMainStage.onTaskVanished(mMainChild); mSideStage.onTaskVanished(mSideChild); mStageCoordinator.onRecentsInSplitAnimationStart(mock(SurfaceControl.Transaction.class)); mStageCoordinator.onRecentsInSplitAnimationStart(mock(TransitionInfo.class)); assertTrue(mStageCoordinator.isSplitScreenVisible()); // Make sure it cleans-up if recents doesn't restore Loading Loading @@ -307,7 +307,7 @@ public class SplitTransitionTests extends ShellTestCase { // simulate the start of recents transition mMainStage.onTaskVanished(mMainChild); mSideStage.onTaskVanished(mSideChild); mStageCoordinator.onRecentsInSplitAnimationStart(mock(SurfaceControl.Transaction.class)); mStageCoordinator.onRecentsInSplitAnimationStart(mock(TransitionInfo.class)); assertTrue(mStageCoordinator.isSplitScreenVisible()); // Make sure we remain in split after recents restores. Loading