Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 695dbf13 authored by Hongwei Wang's avatar Hongwei Wang Committed by Automerger Merge Worker
Browse files

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

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

Change-Id: I43e09b1fe3cfb25ec4b327284e788745ecacb936
parents 3fac6d37 833bf803
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -243,7 +243,8 @@ class PinnedTaskController {
            int oldRotation, int newRotation) {
            int oldRotation, int newRotation) {
        final Rect bounds = mDestRotatedBounds;
        final Rect bounds = mDestRotatedBounds;
        final PictureInPictureSurfaceTransaction pipTx = mPipTransaction;
        final PictureInPictureSurfaceTransaction pipTx = mPipTransaction;
        if (bounds == null && pipTx == null) {
        final boolean emptyPipPositionTx = pipTx == null || pipTx.mPosition == null;
        if (bounds == null && emptyPipPositionTx) {
            return;
            return;
        }
        }
        final TaskDisplayArea taskArea = mDisplayContent.getDefaultTaskDisplayArea();
        final TaskDisplayArea taskArea = mDisplayContent.getDefaultTaskDisplayArea();
@@ -255,7 +256,7 @@ class PinnedTaskController {
        mDestRotatedBounds = null;
        mDestRotatedBounds = null;
        mPipTransaction = null;
        mPipTransaction = null;
        final Rect areaBounds = taskArea.getBounds();
        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
            // The transaction from recents animation is in old rotation. So the position needs to
            // be rotated.
            // be rotated.
            float dx = pipTx.mPosition.x;
            float dx = pipTx.mPosition.x;