Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6bbc387 authored by Jerry Chang's avatar Jerry Chang Committed by Automerger Merge Worker
Browse files

Merge "Fix splitting with wrong apps when entering split with rotation" into...

Merge "Fix splitting with wrong apps when entering split with rotation" into tm-qpr-dev am: aeec8347 am: 464ce81a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21690422



Change-Id: I21e16d0a1af755b006e7513a71890d400a289661
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c4d91fb7 464ce81a
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -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 mIsSplitEntering;
    private boolean mIsDividerRemoteAnimating;
    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;
        mIsSplitEntering = true;
        mIsDividerRemoteAnimating = 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) {
        mIsSplitEntering = false;
        mIsDividerRemoteAnimating = false;
        mShouldUpdateRecents = true;
        mSplitRequest = null;
        // If any stage has no child after animation finished, it means that split will display
@@ -1247,7 +1247,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
            }
        });
        mShouldUpdateRecents = false;
        mIsSplitEntering = false;
        mIsDividerRemoteAnimating = false;

        mSplitLayout.getInvisibleBounds(mTempRect1);
        if (childrenToTop == null || childrenToTop.getTopVisibleChildTaskId() == INVALID_TASK_ID) {
@@ -1590,7 +1590,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.
            mIsSplitEntering = false;
            mIsDividerRemoteAnimating = false;
            mSplitLayout.update(null /* t */);
            onLayoutSizeChanged(mSplitLayout);
        }
@@ -1640,9 +1640,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() && isSplitActive()
                && !mIsSplitEntering) {
            // Handle entring split case here if split already running background.
                && mSplitRequest == null) {
            if (mIsDropEntering) {
                mSplitLayout.resetDividerPosition();
            } else {
@@ -1734,7 +1734,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        mDividerVisible = visible;
        sendSplitVisibilityChanged();

        if (mIsSplitEntering) {
        if (mIsDividerRemoteAnimating) {
            ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                    "   Skip animating divider bar due to it's remote animating.");
            return;
@@ -1754,7 +1754,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    "   Skip animating divider bar due to divider leash not ready.");
            return;
        }
        if (mIsSplitEntering) {
        if (mIsDividerRemoteAnimating) {
            ProtoLog.d(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                    "   Skip animating divider bar due to it's remote animating.");
            return;
@@ -1822,7 +1822,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                mSplitLayout.flingDividerToDismiss(
                        mSideStagePosition != SPLIT_POSITION_BOTTOM_OR_RIGHT,
                        EXIT_REASON_APP_FINISHED);
            } else if (!isSplitScreenVisible() && !mIsSplitEntering) {
            } else if (!isSplitScreenVisible() && mSplitRequest == null) {
                // Dismiss split screen in the background once any sides of the split become empty.
                exitSplitScreen(null /* childrenToTop */, EXIT_REASON_APP_FINISHED);
            }
        } else if (isSideStage && hasChildren && !mMainStage.isActive()) {