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

This commit is contained in:
Jerry Chang
2021-12-23 14:37:08 +00:00
committed by Android (Google) Code Review
2 changed files with 22 additions and 5 deletions

View File

@@ -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,

View File

@@ -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;
}