Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +8 −0 Original line number Diff line number Diff line Loading @@ -979,6 +979,12 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange ) ); mDividerFlingAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { super.onAnimationStart(animation); mParentContainerCallbacks.onSplitLayoutAnimating(true /*animating*/); } @Override public void onAnimationEnd(Animator animation) { if (flingFinishedCallback != null) { Loading @@ -987,11 +993,13 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange mInteractionJankMonitor.end( CUJ_SPLIT_SCREEN_RESIZE); mDividerFlingAnimator = null; mParentContainerCallbacks.onSplitLayoutAnimating(false /*animating*/); } @Override public void onAnimationCancel(Animator animation) { mDividerFlingAnimator = null; mParentContainerCallbacks.onSplitLayoutAnimating(false /*animating*/); } }); mDividerFlingAnimator.start(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitWindowManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ public final class SplitWindowManager extends WindowlessWindowManager { void onLeashReady(SurfaceControl leash); /** Inflates the given touch zone on the appropriate stage root. */ void inflateOnStageRoot(OffscreenTouchZone touchZone); /** Called when any visual animations w/ split layout are happening. */ void onSplitLayoutAnimating(boolean animating); } public SplitWindowManager(String windowName, Context context, Configuration config, Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java +1 −1 Original line number Diff line number Diff line Loading @@ -501,7 +501,7 @@ class SplitScreenTransitions { mPendingEnter.onConsumed(aborted); mPendingEnter = null; mStageCoordinator.notifySplitAnimationFinished(); mStageCoordinator.notifySplitAnimationStatus(false /*animationRunning*/); ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "onTransitionConsumed for enter transition"); } else if (isPendingDismiss(transition)) { mPendingDismiss.onConsumed(aborted); Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +18 −9 Original line number Diff line number Diff line Loading @@ -376,6 +376,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, rootTaskInfo.configuration, mSyncQueue, touchZone.isTopLeft() ? topLeftLeash : bottomRightLeash); } @Override public void onSplitLayoutAnimating(boolean animating) { notifySplitAnimationStatus(animating); } }; protected StageCoordinator(Context context, int displayId, SyncTransactionQueue syncQueue, Loading Loading @@ -1396,6 +1401,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // layers anymore. populateTouchZones() is called in the end callback to inflate new touch // layers in the appropriate places. mSplitLayout.removeTouchZones(); notifySplitAnimationStatus(true /*animationRunning*/); mSplitLayout.playSwapAnimation(t, topLeftStage, bottomRightStage, insets -> { Loading @@ -1417,6 +1423,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSplitLayout.updateStateWithCurrentPosition(); updateSurfaceBounds(mSplitLayout, st, false /* applyResizingOffset */); mSplitLayout.populateTouchZones(); notifySplitAnimationStatus(false /*animationRunning*/); // updateSurfaceBounds(), above, officially puts the two apps in their new // stages. Starting on the next frame, all calculations are made using the Loading Loading @@ -3403,7 +3410,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mMixedHandler.animatePendingEnterPipFromSplit(transition, info, startTransaction, finishTransaction, finishCallback, keepSplitWithPip); notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); return true; } Loading Loading @@ -3460,7 +3467,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // the transition, or synchronize task-org callbacks. } // Use normal animations. notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); return false; } else if (mMixedHandler != null && TransitionUtil.hasDisplayChange(info)) { // A display-change has been un-expectedly inserted into the transition. Redirect Loading @@ -3474,7 +3481,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSplitLayout.update(startTransaction, true /* resetImePosition */); startTransaction.apply(); } notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); return true; } } else if (mSplitTransitions.isPendingPassThrough(transition)) { Loading @@ -3482,7 +3489,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, "startAnimation: passThrough transition=%d", info.getDebugId()); mSplitTransitions.mPendingRemotePassthrough.mRemoteHandler.startAnimation(transition, info, startTransaction, finishTransaction, finishCallback); notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); return true; } Loading Loading @@ -3755,7 +3762,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, enterTransition.setFinishedCallback((callbackWct, callbackT) -> { if (!enterTransition.mResizeAnim) { // If resizing, we'll call notify at the end of the resizing animation (below) notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); } if (finalMainChild != null) { if (!mainNotContainOpenTask) { Loading @@ -3778,7 +3785,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } if (enterTransition.mResizeAnim) { mShowDecorImmediately = true; mSplitLayout.flingDividerToCenter(this::notifySplitAnimationFinished); mSplitLayout.flingDividerToCenter(() -> { notifySplitAnimationStatus(false /*animationRunning*/); }); } int displayId = SplitMultiDisplayHelper.getTransitionDisplayId(info); callbackWct.setReparentLeafTaskIfRelaunch(mSplitMultiDisplayHelper Loading Loading @@ -4304,15 +4313,15 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, private void handleUnsupportedSplitStart() { mSplitUnsupportedToast.show(); notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); } void notifySplitAnimationFinished() { void notifySplitAnimationStatus(boolean animationRunning) { if (mSplitInvocationListener == null || mSplitInvocationListenerExecutor == null) { return; } mSplitInvocationListenerExecutor.execute(() -> mSplitInvocationListener.onSplitAnimationInvoked(false /*animationRunning*/)); mSplitInvocationListener.onSplitAnimationInvoked(animationRunning)); } /** Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +8 −0 Original line number Diff line number Diff line Loading @@ -979,6 +979,12 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange ) ); mDividerFlingAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { super.onAnimationStart(animation); mParentContainerCallbacks.onSplitLayoutAnimating(true /*animating*/); } @Override public void onAnimationEnd(Animator animation) { if (flingFinishedCallback != null) { Loading @@ -987,11 +993,13 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange mInteractionJankMonitor.end( CUJ_SPLIT_SCREEN_RESIZE); mDividerFlingAnimator = null; mParentContainerCallbacks.onSplitLayoutAnimating(false /*animating*/); } @Override public void onAnimationCancel(Animator animation) { mDividerFlingAnimator = null; mParentContainerCallbacks.onSplitLayoutAnimating(false /*animating*/); } }); mDividerFlingAnimator.start(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitWindowManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ public final class SplitWindowManager extends WindowlessWindowManager { void onLeashReady(SurfaceControl leash); /** Inflates the given touch zone on the appropriate stage root. */ void inflateOnStageRoot(OffscreenTouchZone touchZone); /** Called when any visual animations w/ split layout are happening. */ void onSplitLayoutAnimating(boolean animating); } public SplitWindowManager(String windowName, Context context, Configuration config, Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java +1 −1 Original line number Diff line number Diff line Loading @@ -501,7 +501,7 @@ class SplitScreenTransitions { mPendingEnter.onConsumed(aborted); mPendingEnter = null; mStageCoordinator.notifySplitAnimationFinished(); mStageCoordinator.notifySplitAnimationStatus(false /*animationRunning*/); ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "onTransitionConsumed for enter transition"); } else if (isPendingDismiss(transition)) { mPendingDismiss.onConsumed(aborted); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +18 −9 Original line number Diff line number Diff line Loading @@ -376,6 +376,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, rootTaskInfo.configuration, mSyncQueue, touchZone.isTopLeft() ? topLeftLeash : bottomRightLeash); } @Override public void onSplitLayoutAnimating(boolean animating) { notifySplitAnimationStatus(animating); } }; protected StageCoordinator(Context context, int displayId, SyncTransactionQueue syncQueue, Loading Loading @@ -1396,6 +1401,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // layers anymore. populateTouchZones() is called in the end callback to inflate new touch // layers in the appropriate places. mSplitLayout.removeTouchZones(); notifySplitAnimationStatus(true /*animationRunning*/); mSplitLayout.playSwapAnimation(t, topLeftStage, bottomRightStage, insets -> { Loading @@ -1417,6 +1423,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSplitLayout.updateStateWithCurrentPosition(); updateSurfaceBounds(mSplitLayout, st, false /* applyResizingOffset */); mSplitLayout.populateTouchZones(); notifySplitAnimationStatus(false /*animationRunning*/); // updateSurfaceBounds(), above, officially puts the two apps in their new // stages. Starting on the next frame, all calculations are made using the Loading Loading @@ -3403,7 +3410,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mMixedHandler.animatePendingEnterPipFromSplit(transition, info, startTransaction, finishTransaction, finishCallback, keepSplitWithPip); notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); return true; } Loading Loading @@ -3460,7 +3467,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // the transition, or synchronize task-org callbacks. } // Use normal animations. notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); return false; } else if (mMixedHandler != null && TransitionUtil.hasDisplayChange(info)) { // A display-change has been un-expectedly inserted into the transition. Redirect Loading @@ -3474,7 +3481,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSplitLayout.update(startTransaction, true /* resetImePosition */); startTransaction.apply(); } notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); return true; } } else if (mSplitTransitions.isPendingPassThrough(transition)) { Loading @@ -3482,7 +3489,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, "startAnimation: passThrough transition=%d", info.getDebugId()); mSplitTransitions.mPendingRemotePassthrough.mRemoteHandler.startAnimation(transition, info, startTransaction, finishTransaction, finishCallback); notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); return true; } Loading Loading @@ -3755,7 +3762,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, enterTransition.setFinishedCallback((callbackWct, callbackT) -> { if (!enterTransition.mResizeAnim) { // If resizing, we'll call notify at the end of the resizing animation (below) notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); } if (finalMainChild != null) { if (!mainNotContainOpenTask) { Loading @@ -3778,7 +3785,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } if (enterTransition.mResizeAnim) { mShowDecorImmediately = true; mSplitLayout.flingDividerToCenter(this::notifySplitAnimationFinished); mSplitLayout.flingDividerToCenter(() -> { notifySplitAnimationStatus(false /*animationRunning*/); }); } int displayId = SplitMultiDisplayHelper.getTransitionDisplayId(info); callbackWct.setReparentLeafTaskIfRelaunch(mSplitMultiDisplayHelper Loading Loading @@ -4304,15 +4313,15 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, private void handleUnsupportedSplitStart() { mSplitUnsupportedToast.show(); notifySplitAnimationFinished(); notifySplitAnimationStatus(false /*animationRunning*/); } void notifySplitAnimationFinished() { void notifySplitAnimationStatus(boolean animationRunning) { if (mSplitInvocationListener == null || mSplitInvocationListenerExecutor == null) { return; } mSplitInvocationListenerExecutor.execute(() -> mSplitInvocationListener.onSplitAnimationInvoked(false /*animationRunning*/)); mSplitInvocationListener.onSplitAnimationInvoked(animationRunning)); } /** Loading