Merge "Fix WM shell crash when targets belong to a different display." into tm-qpr-dev am: d002c621c2 am: ebf91d3e5f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20637595

Change-Id: Id54d0cea74239f27fc9d8ee3137116f7baf35450
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Issei Suzuki
2022-12-06 20:10:59 +00:00
committed by Automerger Merge Worker

View File

@@ -1617,8 +1617,11 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
WindowContainer<?> ancestor = findCommonAncestor(sortedTargets, changes, topApp);
// make leash based on highest (z-order) direct child of ancestor with a participant.
WindowContainer leashReference = sortedTargets.get(0);
// Make leash based on highest (z-order) direct child of ancestor with a participant.
// TODO(b/261418859): Handle the case when the target contains window containers which
// belong to a different display. As a workaround we use topApp, from which wallpaper
// window container is removed, instead of sortedTargets here.
WindowContainer leashReference = topApp;
while (leashReference.getParent() != ancestor) {
leashReference = leashReference.getParent();
}