Fix timeout when dismissing split screen to two pane mode

After I1a0c4d17, the expanding task will first be resized to fullscreen
then reparent to TDA after the divider bar fling animation finished. If
the expanding app is expanding to two pane mode, the resuming of the
second activity might be skpped due to the task in another side of the
split is already empty and invisible.

Update the drag-to-dismiss flow to reorder the expanding task on the top
of dismissing task. So the content in the dismissing side won't flicker
during the dismissing transition and the activity resume won't be
skipped in the expanding side.

Fix: 243368173
Test: atest WMShellFlickerTests
Test: atest WMShellUnitTests
Test: put Settings and Chrome in split screen,
      drag divider bar to dismiss Chrome,
      verified the expanding transition won't timeout
Change-Id: Id16c1d9b4849d5f600de9524ffebb91aba73a721
This commit is contained in:
Jerry Chang
2022-09-14 17:13:04 +00:00
parent 76395aec8b
commit d65119ec02
5 changed files with 5 additions and 24 deletions

View File

@@ -45,11 +45,6 @@ class MainStage extends StageTaskListener {
iconProvider);
}
@Override
void dismiss(WindowContainerTransaction wct, boolean toTop) {
deactivate(wct, toTop);
}
boolean isActive() {
return mIsActive;
}

View File

@@ -42,11 +42,6 @@ class SideStage extends StageTaskListener {
iconProvider);
}
@Override
void dismiss(WindowContainerTransaction wct, boolean toTop) {
removeAllTasks(wct, toTop);
}
boolean removeAllTasks(WindowContainerTransaction wct, boolean toTop) {
if (mChildrenTaskInfo.size() == 0) return false;
wct.reparentTasks(

View File

@@ -901,13 +901,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
// Expand to top side split as full screen for fading out decor animation and dismiss
// another side split(Moving its children to bottom).
mIsExiting = true;
final StageTaskListener tempFullStage = childrenToTop;
final StageTaskListener dismissStage = mMainStage == childrenToTop
? mSideStage : mMainStage;
tempFullStage.resetBounds(wct);
wct.setSmallestScreenWidthDp(tempFullStage.mRootTaskInfo.token,
childrenToTop.resetBounds(wct);
wct.reorder(childrenToTop.mRootTaskInfo.token, true);
wct.setSmallestScreenWidthDp(childrenToTop.mRootTaskInfo.token,
SMALLEST_SCREEN_WIDTH_DP_UNDEFINED);
dismissStage.dismiss(wct, false /* toTop */);
}
mSyncQueue.queue(wct);
mSyncQueue.runInSync(t -> {
@@ -924,7 +921,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
childrenToTop.fadeOutDecor(() -> {
WindowContainerTransaction finishedWCT = new WindowContainerTransaction();
mIsExiting = false;
childrenToTop.dismiss(finishedWCT, true /* toTop */);
mMainStage.deactivate(finishedWCT, childrenToTop == mMainStage /* toTop */);
mSideStage.removeAllTasks(finishedWCT, childrenToTop == mSideStage /* toTop */);
finishedWCT.reorder(mRootTaskInfo.token, false /* toTop */);
finishedWCT.setForceTranslucent(mRootTaskInfo.token, true);
finishedWCT.setBounds(mSideStage.mRootTaskInfo.token, mTempRect1);

View File

@@ -106,11 +106,6 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
taskOrganizer.createRootTask(displayId, WINDOWING_MODE_MULTI_WINDOW, this);
}
/**
* General function for dismiss this stage.
*/
void dismiss(WindowContainerTransaction wct, boolean toTop) {}
int getChildCount() {
return mChildrenTaskInfo.size();
}

View File

@@ -227,7 +227,6 @@ public class StageCoordinatorTests extends ShellTestCase {
mStageCoordinator.exitSplitScreen(testTaskId, EXIT_REASON_RETURN_HOME);
verify(mMainStage).reorderChild(eq(testTaskId), eq(true),
any(WindowContainerTransaction.class));
verify(mSideStage).dismiss(any(WindowContainerTransaction.class), eq(false));
verify(mMainStage).resetBounds(any(WindowContainerTransaction.class));
}
@@ -241,7 +240,6 @@ public class StageCoordinatorTests extends ShellTestCase {
verify(mSideStage).reorderChild(eq(testTaskId), eq(true),
any(WindowContainerTransaction.class));
verify(mSideStage).resetBounds(any(WindowContainerTransaction.class));
verify(mMainStage).dismiss(any(WindowContainerTransaction.class), eq(false));
}
@Test