From 2dd6381527758345693b52107d05eb629291ea8e Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Thu, 9 Dec 2021 14:54:49 -0800 Subject: [PATCH] Reset inherit-parent bounds in finishTransaction Since shell doesn't know about inherited bounds, reset them in finishTransaction so that tasks aren't left with an outdated crop. This is mainly to remedy an issue with rotation where the animation (in shell) needs to set the task crop for the duration of the animation, but doesn't know if it needs to unset it or leave it. Bug: 210065870 Test: open app, rotate to landscape, dismiss app to home, rotate to portrait, launch (resume) app. Change-Id: I8fcfbe6d444cc3a5387be216e5ea9a1d4fb12a7e --- services/core/java/com/android/server/wm/Transition.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java index 39747472b2da5..dae004dd5f6f0 100644 --- a/services/core/java/com/android/server/wm/Transition.java +++ b/services/core/java/com/android/server/wm/Transition.java @@ -365,6 +365,13 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe t.setPosition(targetLeash, tmpPos.x, tmpPos.y); t.setCornerRadius(targetLeash, 0); t.setShadowRadius(targetLeash, 0); + // The bounds sent to the transition is always a real bounds. This means we lose + // information about "null" bounds (inheriting from parent). Core will fix-up + // non-organized window surface bounds; however, since Core can't touch organized + // surfaces, add the "inherit from parent" restoration here. + if (target.isOrganized() && target.matchParentBounds()) { + t.setWindowCrop(targetLeash, -1, -1); + } displays.add(target.getDisplayContent()); } }