Fix screenshotting with includeDecor=true in multi-window

The old code wasn't really tested and stackBounds variable was
null in any case.

Test: Go to multi-window, go to recents, make sure screenshot is
correct.
Bug: 31339431

Change-Id: I721397800ba7519dba7f569461c5f339eba0591b
This commit is contained in:
Jorim Jaggi
2017-01-20 18:13:01 +01:00
parent 7361babf94
commit bfbd9dc963

View File

@@ -2252,10 +2252,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
}
// Don't include wallpaper in bounds calculation
if (includeDecor && !stackBounds.isEmpty()) {
frame.set(stackBounds);
} else if (includeDecor) {
mutableIncludeFullDisplay.value = true;
if (!mutableIncludeFullDisplay.value && includeDecor) {
final TaskStack stack = w.getStack();
if (stack != null) {
stack.getBounds(frame);
}
} else if (!mutableIncludeFullDisplay.value && !w.mIsWallpaper) {
final Rect wf = w.mFrame;
final Rect cr = w.mContentInsets;