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

Commit 066b8a16 authored by Evan Rosky's avatar Evan Rosky
Browse files

Update non-inherited task surface crops during syncs

We generally want to let shell manage the surfaces of
tasks that it organizes. However, one of the transition
contracts is that the startTransaction, when applied,
should produce the "end state". This means that we want
WM to include surface changes during sync -- otherwise
if a change wasn't a direct participant of a transition,
but still changed, that change won't be represented.

Bug: 410684072
Test: resize splits with a aspect/size restricted task
Flag: com.android.window.flags.update_task_crop_in_sync
Change-Id: Ie2aad45380c9f7a5bdf4422b3be923f933e838fe
parent f03f56ad
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -487,3 +487,13 @@ flag {
    description: "Use a fallback transition-player while sysui is starting or crashed."
    bug: "365884835"
}

flag {
    name: "update_task_crop_in_sync"
    namespace: "windowing_frontend"
    description: "Fixes a bug where we fail to update task crops during transitions"
    bug: "410684072"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+7 −2
Original line number Diff line number Diff line
@@ -2430,14 +2430,19 @@ class Task extends TaskFragment {
    }

    void updateSurfaceSize(SurfaceControl.Transaction transaction) {
        if (mSurfaceControl == null || isOrganized()) {
        final boolean inSync = mSyncState != SYNC_STATE_NONE;
        if (mSurfaceControl == null
                // Organized tasks are controlled by shell, so only manipulate those surfaces
                // during syncs
                || (isOrganized() && (!Flags.updateTaskCropInSync() || !inSync))) {
            return;
        }

        // Apply crop to root tasks only and clear the crops of the descendant tasks.
        int width = 0;
        int height = 0;
        if (isRootTask() && !mTransitionController.mIsWaitingForDisplayEnabled) {
        if ((isRootTask() || (Flags.updateTaskCropInSync() && !fillsParentBounds()))
                && !mTransitionController.mIsWaitingForDisplayEnabled) {
            final Rect taskBounds = getBounds();
            width = taskBounds.width();
            height = taskBounds.height();