Merge "Fix content insets calculation error when taking task snapshot." am: fe0504b2a9 am: 6f82d9993d

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1930818

Change-Id: I8e23cb51aed4383dafd5d4bc36596e3c13475389
This commit is contained in:
Tiger Huang
2022-02-22 09:23:57 +00:00
committed by Automerger Merge Worker

View File

@@ -295,7 +295,7 @@ class TaskSnapshotController {
} }
final ActivityRecord activity = result.first; final ActivityRecord activity = result.first;
final WindowState mainWindow = result.second; final WindowState mainWindow = result.second;
final Rect contentInsets = getSystemBarInsets(task.getBounds(), final Rect contentInsets = getSystemBarInsets(mainWindow.getFrame(),
mainWindow.getInsetsStateWithVisibilityOverride()); mainWindow.getInsetsStateWithVisibilityOverride());
final Rect letterboxInsets = activity.getLetterboxInsets(); final Rect letterboxInsets = activity.getLetterboxInsets();
InsetUtils.addInsets(contentInsets, letterboxInsets); InsetUtils.addInsets(contentInsets, letterboxInsets);
@@ -563,7 +563,7 @@ class TaskSnapshotController {
final LayoutParams attrs = mainWindow.getAttrs(); final LayoutParams attrs = mainWindow.getAttrs();
final Rect taskBounds = task.getBounds(); final Rect taskBounds = task.getBounds();
final InsetsState insetsState = mainWindow.getInsetsStateWithVisibilityOverride(); final InsetsState insetsState = mainWindow.getInsetsStateWithVisibilityOverride();
final Rect systemBarInsets = getSystemBarInsets(taskBounds, insetsState); final Rect systemBarInsets = getSystemBarInsets(mainWindow.getFrame(), insetsState);
final SystemBarBackgroundPainter decorPainter = new SystemBarBackgroundPainter(attrs.flags, final SystemBarBackgroundPainter decorPainter = new SystemBarBackgroundPainter(attrs.flags,
attrs.privateFlags, attrs.insetsFlags.appearance, task.getTaskDescription(), attrs.privateFlags, attrs.insetsFlags.appearance, task.getTaskDescription(),
mHighResTaskSnapshotScale, insetsState); mHighResTaskSnapshotScale, insetsState);