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

Commit 8959d0b1 authored by Jerry Chang's avatar Jerry Chang
Browse files

Fix back to split pair from overview with shell-transition hang.

Prevent it throws index out of bounds exception when entering split pair
from overview panel. And make sure to update split screen state properly
when enter split transition got merged to other transition.

Fix: 210852531
Bug: 206487881
Test: Trigger split screen, swipe up to overview, verified it won't hang
      when select split pair from overview panel.
Change-Id: Ifc5c224b7185224b811e6e2e7fa5d798c99bc6b1
parent 78432215
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -1207,6 +1207,27 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        return out;
    }

    @Override
    public void onTransitionMerged(@NonNull IBinder transition) {
        // Once the pending enter transition got merged, make sure to bring divider bar visible and
        // clear the pending transition from cache to prevent mess-up the following state.
        if (transition == mSplitTransitions.mPendingEnter) {
            mSplitLayout.init();
            setDividerVisibility(true, null /* transaction */);
            setSplitsVisible(true);
            mShouldUpdateRecents = true;
            updateRecentTasksSplitPair();

            if (!mLogger.hasStartedSession()) {
                mLogger.logEnter(mSplitLayout.getDividerPositionAsFraction(),
                        getMainStagePosition(), mMainStage.getTopChildTaskUid(),
                        getSideStagePosition(), mSideStage.getTopChildTaskUid(),
                        mSplitLayout.isLandscape());
            }
            mSplitTransitions.mPendingEnter = null;
        }
    }

    @Override
    public boolean startAnimation(@NonNull IBinder transition,
            @NonNull TransitionInfo info,
+1 −5
Original line number Diff line number Diff line
@@ -246,10 +246,6 @@ public class RemoteTransitionCompat implements Parcelable {
                if (mPausingTasks.contains(openingTasks.get(i).getContainer())) {
                    ++pauseMatches;
                }
                if (openingTasks.get(i).getContainer().equals(mPausingTasks.get(i))) {
                    // In this case, we are "returning" to an already running app, so just consume
                    // the merge and do nothing.
                }
            }
            if (pauseMatches > 0) {
                if (pauseMatches != mPausingTasks.size()) {
@@ -275,9 +271,9 @@ public class RemoteTransitionCompat implements Parcelable {
                t.reparent(target.leash.mSurfaceControl, mInfo.getRootLeash());
                t.setLayer(target.leash.mSurfaceControl, layer);
                t.hide(target.leash.mSurfaceControl);
                t.apply();
                targets[i] = target;
            }
            t.apply();
            recents.onTasksAppeared(targets);
            return true;
        }