From 4da861b61470569fb99548ae0f9853834e4375e8 Mon Sep 17 00:00:00 2001 From: shawnlin Date: Wed, 25 Nov 2020 15:05:06 +0800 Subject: [PATCH] Image wallpaper is scaled to the cutout area when enable hide display cutout Image wallpaper has a scale animation when entering launcher which make the wallpaper scale to the cutout area. Set window crop to prevent this Bug: 174210114 Test: manual 1. set image wallpaper 2. enable hide display cutout 3. back to launcher Change-Id: Ie2edc5974dcf6efc9554d70732af46f650888fd4 --- .../wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizer.java index 090d2270817bd..4e62ea6e72338 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizer.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizer.java @@ -272,8 +272,9 @@ class HideDisplayCutoutOrganizer extends DisplayAreaOrganizer { @VisibleForTesting void applyBoundsAndOffsets(WindowContainerToken token, SurfaceControl leash, WindowContainerTransaction wct, SurfaceControl.Transaction t) { - wct.setBounds(token, mCurrentDisplayBounds.isEmpty() ? null : mCurrentDisplayBounds); + wct.setBounds(token, mCurrentDisplayBounds); t.setPosition(leash, mOffsetX, mOffsetY); + t.setWindowCrop(leash, mCurrentDisplayBounds.width(), mCurrentDisplayBounds.height()); } @VisibleForTesting