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

Commit 528a1061 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Fix NPE in PinnedTaskController

Bug: 210570569
Test: follow the steps in bug report
Change-Id: I8d09142e277e0d7bae21dd68db52fefe71a1bf95
parent e805f2b1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;