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

Commit c32f35a1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Don't offset TaskView when it is not in the bounds of parent." into...

Merge "Don't offset TaskView when it is not in the bounds of parent." into tm-qpr-dev am: 6c9cd270

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



Change-Id: I0868277cbf90d0bb9d9a14e417817e60fd84d5b7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f75449a2 6c9cd270
Loading
Loading
Loading
Loading
+7 −12
Original line number Diff line number Diff line
@@ -224,16 +224,6 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
        mObscuredTouchRegion = obscuredRegion;
    }

    private void onLocationChanged(WindowContainerTransaction wct) {
        // Update based on the screen bounds
        getBoundsOnScreen(mTmpRect);
        getRootView().getBoundsOnScreen(mTmpRootRect);
        if (!mTmpRootRect.contains(mTmpRect)) {
            mTmpRect.offsetTo(0, 0);
        }
        wct.setBounds(mTaskToken, mTmpRect);
    }

    /**
     * Call when view position or size has changed. Do not call when animating.
     */
@@ -246,10 +236,15 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
        if (isUsingShellTransitions() && mTaskViewTransitions.hasPending()) return;

        WindowContainerTransaction wct = new WindowContainerTransaction();
        onLocationChanged(wct);
        updateWindowBounds(wct);
        mSyncQueue.queue(wct);
    }

    private void updateWindowBounds(WindowContainerTransaction wct) {
        getBoundsOnScreen(mTmpRect);
        wct.setBounds(mTaskToken, mTmpRect);
    }

    /**
     * Release this container if it is initialized.
     */
@@ -573,7 +568,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
                    .apply();

            // TODO: determine if this is really necessary or not
            onLocationChanged(wct);
            updateWindowBounds(wct);
        } else {
            // The surface has already been destroyed before the task has appeared,
            // so go ahead and hide the task entirely