Merge "Fix timeout when dismissing split screen to two pane mode" into tm-qpr-dev

This commit is contained in:
Jerry Chang
2022-09-16 00:51:43 +00:00
committed by Android (Google) Code Review
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

@@ -934,13 +934,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 -> {
@@ -957,7 +954,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

@@ -225,7 +225,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));
}
@@ -239,7 +238,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