From 2be23a9fdf97b90feb5535505a71b865d040e5bb Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Thu, 13 Jun 2019 16:22:35 +0200 Subject: [PATCH] Use task bounds when drawing app theme snapshot Otherwise the buffer we draw isn't really consistent with the normal case, where we always create a buffer the size of the task. Test: Quick switch with Camera Fixes: 130020567 Change-Id: I222ec7e6d3112384d0981519b39be951ea855c1c --- .../java/com/android/server/wm/TaskSnapshotController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/wm/TaskSnapshotController.java b/services/core/java/com/android/server/wm/TaskSnapshotController.java index 1815218503695..d526e7c13041a 100644 --- a/services/core/java/com/android/server/wm/TaskSnapshotController.java +++ b/services/core/java/com/android/server/wm/TaskSnapshotController.java @@ -379,8 +379,8 @@ class TaskSnapshotController { final LayoutParams attrs = mainWindow.getAttrs(); final SystemBarBackgroundPainter decorPainter = new SystemBarBackgroundPainter(attrs.flags, attrs.privateFlags, attrs.systemUiVisibility, task.getTaskDescription()); - final int width = mainWindow.getFrameLw().width(); - final int height = mainWindow.getFrameLw().height(); + final int width = task.getBounds().width(); + final int height = task.getBounds().height(); final RenderNode node = RenderNode.create("TaskSnapshotController", null); node.setLeftTopRightBottom(0, 0, width, height); @@ -398,7 +398,7 @@ class TaskSnapshotController { // color above return new TaskSnapshot(topChild.mActivityComponent, hwBitmap.createGraphicBufferHandle(), hwBitmap.getColorSpace(), topChild.getConfiguration().orientation, - mainWindow.getStableInsets(), ActivityManager.isLowRamDeviceStatic() /* reduced */, + getInsets(mainWindow), ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */, false /* isRealSnapshot */, task.getWindowingMode(), getSystemUiVisibility(task), false); }