Copy insets state for snapshot starting window

Commit 837fd13 remove the copy accidentally. That causes the
original insets state to be modified unexpectedly.

Bug: 168023253
Test: WmTests
Change-Id: I31242e6e325a1df2afeac77faf6b2af05c0de138
This commit is contained in:
Riddle Hsu
2020-09-21 17:57:50 +08:00
parent a67c5344ac
commit 0fe3b00cba
2 changed files with 2 additions and 2 deletions

View File

@@ -481,7 +481,7 @@ class TaskSnapshotController {
final int color = ColorUtils.setAlphaComponent(
task.getTaskDescription().getBackgroundColor(), 255);
final LayoutParams attrs = mainWindow.getAttrs();
final InsetsState insetsState = mainWindow.getInsetsState();
final InsetsState insetsState = new InsetsState(mainWindow.getInsetsState());
mergeInsetsSources(insetsState, mainWindow.getRequestedInsetsState());
final Rect systemBarInsets = getSystemBarInsets(mainWindow.getFrame(), insetsState);
final SystemBarBackgroundPainter decorPainter = new SystemBarBackgroundPainter(attrs.flags,

View File

@@ -237,7 +237,7 @@ class TaskSnapshotSurface implements StartingSurface {
task.getBounds(taskBounds);
currentOrientation = topFullscreenOpaqueWindow.getConfiguration().orientation;
activityType = activity.getActivityType();
insetsState = topFullscreenOpaqueWindow.getInsetsState();
insetsState = new InsetsState(topFullscreenOpaqueWindow.getInsetsState());
mergeInsetsSources(insetsState, topFullscreenOpaqueWindow.getRequestedInsetsState());
}
try {