diff options
| author | 2023-03-02 07:33:02 +0000 | |
|---|---|---|
| committer | 2023-03-02 07:33:02 +0000 | |
| commit | d3d69be3ce1ab5f91c7b069e886093b3be9a6bf5 (patch) | |
| tree | bb0838188964ba51836d82871ae01fac13fdba7c | |
| parent | 970299f27faed129a80b5e9d35ad0146e07e6bda (diff) | |
| parent | 2940697c9c7d6edecc9ce1d14d9945d92139bf4e (diff) | |
Merge "Revert "Fix splitting with wrong apps when entering split with rotation"" into tm-qpr-dev am: 2940697c9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21692220
Change-Id: I140efe05082dea9f3b6174c67fa3dd347383aa37
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index 543da09dc237..a6733843d4c3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -204,7 +204,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // and exit, since exit itself can trigger a number of changes that update the stages. private boolean mShouldUpdateRecents; private boolean mExitSplitScreenOnHide; - private boolean mIsDividerRemoteAnimating; + private boolean mIsSplitEntering; private boolean mIsDropEntering; private boolean mIsExiting; @@ -881,7 +881,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // Set false to avoid record new bounds with old task still on top; mShouldUpdateRecents = false; - mIsDividerRemoteAnimating = true; + mIsSplitEntering = true; if (mSplitRequest == null) { mSplitRequest = new SplitRequest(mainTaskId, mainPendingIntent != null ? mainPendingIntent.getIntent() : null, @@ -974,7 +974,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } private void onRemoteAnimationFinishedOrCancelled(WindowContainerTransaction evictWct) { - mIsDividerRemoteAnimating = false; + mIsSplitEntering = false; mShouldUpdateRecents = true; mSplitRequest = null; // If any stage has no child after animation finished, it means that split will display @@ -1240,7 +1240,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } }); mShouldUpdateRecents = false; - mIsDividerRemoteAnimating = false; + mIsSplitEntering = false; mSplitLayout.getInvisibleBounds(mTempRect1); if (childrenToTop == null || childrenToTop.getTopVisibleChildTaskId() == INVALID_TASK_ID) { @@ -1573,7 +1573,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, && !ENABLE_SHELL_TRANSITIONS) { // Clear the divider remote animating flag as the divider will be re-rendered to apply // the new rotation config. - mIsDividerRemoteAnimating = false; + mIsSplitEntering = false; mSplitLayout.update(null /* t */); onLayoutSizeChanged(mSplitLayout); } @@ -1623,9 +1623,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } void onChildTaskAppeared(StageListenerImpl stageListener, int taskId) { - // Handle entering split screen while there is a split pair running in the background. - if (stageListener == mSideStageListener && !isSplitScreenVisible() - && mSplitRequest == null) { + if (stageListener == mSideStageListener && !isSplitScreenVisible() && isSplitActive() + && !mIsSplitEntering) { + // Handle entring split case here if split already running background. if (mIsDropEntering) { mSplitLayout.resetDividerPosition(); } else { @@ -1717,7 +1717,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mDividerVisible = visible; sendSplitVisibilityChanged(); - if (mIsDividerRemoteAnimating) { + if (mIsSplitEntering) { ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, " Skip animating divider bar due to it's remote animating."); return; @@ -1737,7 +1737,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, " Skip animating divider bar due to divider leash not ready."); return; } - if (mIsDividerRemoteAnimating) { + if (mIsSplitEntering) { ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, " Skip animating divider bar due to it's remote animating."); return; @@ -1805,8 +1805,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSplitLayout.flingDividerToDismiss( mSideStagePosition != SPLIT_POSITION_BOTTOM_OR_RIGHT, EXIT_REASON_APP_FINISHED); - } else if (!isSplitScreenVisible() && mSplitRequest == null) { - // Dismiss split screen in the background once any sides of the split become empty. + } else if (!isSplitScreenVisible() && !mIsSplitEntering) { exitSplitScreen(null /* childrenToTop */, EXIT_REASON_APP_FINISHED); } } else if (isSideStage && hasChildren && !mMainStage.isActive()) { |