Merge "Fix NPE in PinnedTaskController" into sc-v2-dev am: 833bf80362

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

Change-Id: I43e09b1fe3cfb25ec4b327284e788745ecacb936
This commit is contained in:
Hongwei Wang
2021-12-16 00:34:33 +00:00
committed by Automerger Merge Worker

View File

@@ -243,7 +243,8 @@ class PinnedTaskController {
int oldRotation, int newRotation) {
final Rect bounds = mDestRotatedBounds;
final PictureInPictureSurfaceTransaction pipTx = mPipTransaction;
if (bounds == null && pipTx == null) {
final boolean emptyPipPositionTx = pipTx == null || pipTx.mPosition == null;
if (bounds == null && emptyPipPositionTx) {
return;
}
final TaskDisplayArea taskArea = mDisplayContent.getDefaultTaskDisplayArea();
@@ -255,7 +256,7 @@ class PinnedTaskController {
mDestRotatedBounds = null;
mPipTransaction = null;
final Rect areaBounds = taskArea.getBounds();
if (pipTx != null && pipTx.mPosition != null) {
if (!emptyPipPositionTx) {
// The transaction from recents animation is in old rotation. So the position needs to
// be rotated.
float dx = pipTx.mPosition.x;