diff options
| -rw-r--r-- | core/java/android/window/SnapshotDrawerUtils.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/java/android/window/SnapshotDrawerUtils.java b/core/java/android/window/SnapshotDrawerUtils.java index 4c8bad6d0aff..bc663498467a 100644 --- a/core/java/android/window/SnapshotDrawerUtils.java +++ b/core/java/android/window/SnapshotDrawerUtils.java @@ -152,9 +152,11 @@ public class SnapshotDrawerUtils { @VisibleForTesting public void setFrames(Rect frame, Rect systemBarInsets) { mFrame.set(frame); - mSystemBarInsets.set(systemBarInsets); mSizeMismatch = (mFrame.width() != mSnapshotW || mFrame.height() != mSnapshotH); - mSystemBarBackgroundPainter.setInsets(systemBarInsets); + if (!Flags.drawSnapshotAspectRatioMatch() && systemBarInsets != null) { + mSystemBarInsets.set(systemBarInsets); + mSystemBarBackgroundPainter.setInsets(systemBarInsets); + } } private void drawSnapshot(boolean releaseAfterDraw) { @@ -396,9 +398,12 @@ public class SnapshotDrawerUtils { final ActivityManager.RunningTaskInfo runningTaskInfo = info.taskInfo; final ActivityManager.TaskDescription taskDescription = getOrCreateTaskDescription(runningTaskInfo); - drawSurface.initiateSystemBarPainter(lp.flags, lp.privateFlags, - attrs.insetsFlags.appearance, taskDescription, info.requestedVisibleTypes); - final Rect systemBarInsets = getSystemBarInsets(windowBounds, topWindowInsetsState); + Rect systemBarInsets = null; + if (!Flags.drawSnapshotAspectRatioMatch()) { + drawSurface.initiateSystemBarPainter(lp.flags, lp.privateFlags, + attrs.insetsFlags.appearance, taskDescription, info.requestedVisibleTypes); + systemBarInsets = getSystemBarInsets(windowBounds, topWindowInsetsState); + } drawSurface.setFrames(windowBounds, systemBarInsets); drawSurface.drawSnapshot(releaseAfterDraw); } |