Block startSwipePipToHome if entry was scheduled
Generally, Launcher's AbsSwipeUpHandler checks whether
there is a PiP present when deciding whether to block
startSwipePipToHome call to get entry bounds. But sometimes
the Binder call might get through if the entry is scheduled or
even as the animation is running, since TaskStackListener updates
Launcher uses are out-of-sync from Transitions updates.
So if startSwipePipToHome() arrives into PipController, make sure
to return null bounds after verifying that we are not indeed past PiP
entry scheduling stage, so that AbsSwipeUpHandler bails early after the
synchronous Binder call returns.
Note: repro-ing the issue is quite hard, but blocking
startSwipePipToHome at this point also means
reparentChildSurfaceToTask() never gets routed to PipTaskListener which
was the root of the crash we ave been seeing reported.
Bug: 432684815
Flag: EXEMPT bugfix
Test: swipe-up to PiP as soon as app directly enters PiP
Change-Id: I2838366fafbea3641378e2d6c27b9e710fe31075
2 files changed