From 8a1d54f27e22f53fb9470760df004fb2a239fa8c Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Tue, 17 May 2022 11:12:52 -0700 Subject: [PATCH] Add null-check before reparenting content overlay It is a common case that an auto-enter-pip eligible activity specifies source rect hint and there is no content overlay being used during the auto-enter-pip animation. Bug: 232857181 Test: swipe auto-enter-pip eligible activity to home with shell \ transition being turned on Change-Id: Id31d45764e557c5ea5a7918f49e620342cbeeb7a --- .../Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java index 07f2e95dfcb12..222d3c291c0ba 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java @@ -363,7 +363,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, } mPipBoundsState.setBounds(destinationBounds); mSwipePipToHomeOverlay = overlay; - if (ENABLE_SHELL_TRANSITIONS) { + if (ENABLE_SHELL_TRANSITIONS && overlay != null) { // With Shell transition, the overlay was attached to the remote transition leash, which // will be removed when the current transition is finished, so we need to reparent it // to the actual Task surface now.