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
This commit is contained in:
Hongwei Wang
2022-05-17 11:12:52 -07:00
parent 96ad5ccad9
commit 8a1d54f27e

View File

@@ -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.