Fix wrong split bounds if IME shown then rotate

We will shift split window bounds when IME shown but using bounds
in taskinfo. When rotation case, after tracing by log, it seems
sometimes we will get old bounds value before rotation then cause
split layout issue.

Fix this by using bounds computed by SplitLayout itself rather than
using bounds in taskinfo.

Fix: 238736466
Test: manual
Test: pass existing tests
Change-Id: If309858009935e8d7a1d2fa6a2b8dfc4a5004de4
This commit is contained in:
Tony Huang
2022-07-13 16:18:34 +08:00
parent 45b540163a
commit 35a4968041

View File

@@ -716,31 +716,23 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
ActivityManager.RunningTaskInfo taskInfo1, ActivityManager.RunningTaskInfo taskInfo2) {
if (offsetX == 0 && offsetY == 0) {
wct.setBounds(taskInfo1.token, mBounds1);
wct.setAppBounds(taskInfo1.token, null);
wct.setScreenSizeDp(taskInfo1.token,
SCREEN_WIDTH_DP_UNDEFINED, SCREEN_HEIGHT_DP_UNDEFINED);
wct.setBounds(taskInfo2.token, mBounds2);
wct.setAppBounds(taskInfo2.token, null);
wct.setScreenSizeDp(taskInfo2.token,
SCREEN_WIDTH_DP_UNDEFINED, SCREEN_HEIGHT_DP_UNDEFINED);
} else {
mTempRect.set(taskInfo1.configuration.windowConfiguration.getBounds());
getBounds1(mTempRect);
mTempRect.offset(offsetX, offsetY);
wct.setBounds(taskInfo1.token, mTempRect);
mTempRect.set(taskInfo1.configuration.windowConfiguration.getAppBounds());
mTempRect.offset(offsetX, offsetY);
wct.setAppBounds(taskInfo1.token, mTempRect);
wct.setScreenSizeDp(taskInfo1.token,
taskInfo1.configuration.screenWidthDp,
taskInfo1.configuration.screenHeightDp);
mTempRect.set(taskInfo2.configuration.windowConfiguration.getBounds());
getBounds2(mTempRect);
mTempRect.offset(offsetX, offsetY);
wct.setBounds(taskInfo2.token, mTempRect);
mTempRect.set(taskInfo2.configuration.windowConfiguration.getAppBounds());
mTempRect.offset(offsetX, offsetY);
wct.setAppBounds(taskInfo2.token, mTempRect);
wct.setScreenSizeDp(taskInfo2.token,
taskInfo2.configuration.screenWidthDp,
taskInfo2.configuration.screenHeightDp);