Merge "Do not set very small bounds for non-drag case" into udc-qpr-dev

This commit is contained in:
Tony Huang
2023-07-06 03:29:16 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 4 deletions

View File

@@ -773,15 +773,13 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
ActivityManager.RunningTaskInfo task1, ActivityManager.RunningTaskInfo task2) {
boolean boundsChanged = false;
if (!mBounds1.equals(mWinBounds1) || !task1.token.equals(mWinToken1)) {
wct.setBounds(task1.token, mBounds1);
wct.setSmallestScreenWidthDp(task1.token, getSmallestWidthDp(mBounds1));
setTaskBounds(wct, task1, mBounds1);
mWinBounds1.set(mBounds1);
mWinToken1 = task1.token;
boundsChanged = true;
}
if (!mBounds2.equals(mWinBounds2) || !task2.token.equals(mWinToken2)) {
wct.setBounds(task2.token, mBounds2);
wct.setSmallestScreenWidthDp(task2.token, getSmallestWidthDp(mBounds2));
setTaskBounds(wct, task2, mBounds2);
mWinBounds2.set(mBounds2);
mWinToken2 = task2.token;
boundsChanged = true;
@@ -789,6 +787,13 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
return boundsChanged;
}
/** Set bounds to the {@link WindowContainerTransaction} for single task. */
public void setTaskBounds(WindowContainerTransaction wct,
ActivityManager.RunningTaskInfo task, Rect bounds) {
wct.setBounds(task.token, bounds);
wct.setSmallestScreenWidthDp(task.token, getSmallestWidthDp(bounds));
}
private int getSmallestWidthDp(Rect bounds) {
mTempRect.set(bounds);
mTempRect.inset(getDisplayStableInsets(mContext));

View File

@@ -1570,6 +1570,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
// split bounds.
wct.setSmallestScreenWidthDp(mMainStage.mRootTaskInfo.token,
SMALLEST_SCREEN_WIDTH_DP_UNDEFINED);
mSplitLayout.getInvisibleBounds(mTempRect1);
mSplitLayout.setTaskBounds(wct, mSideStage.mRootTaskInfo, mTempRect1);
}
wct.reorder(mRootTaskInfo.token, true);
setRootForceTranslucent(false, wct);