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

Commit d1b8291e authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Updates containers if the updates skipped when Task was invisible" into main

parents a1ff4c14 e74f5aed
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -181,3 +181,14 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "windowing_sdk"
    name: "fix_no_container_update_without_resize"
    description: "Fix the containers not being updated when the Task is brought to front and has the same configuration"
    bug: "344721335"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+10 −1
Original line number Diff line number Diff line
@@ -904,14 +904,23 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen
    @GuardedBy("mLock")
    void updateContainersInTaskIfVisible(@NonNull WindowContainerTransaction wct, int taskId) {
        final TaskContainer taskContainer = getTaskContainer(taskId);
        if (taskContainer != null && taskContainer.isVisible()) {
        if (taskContainer == null) {
            return;
        }

        if (taskContainer.isVisible()) {
            updateContainersInTask(wct, taskContainer);
        } else if (Flags.fixNoContainerUpdateWithoutResize()) {
            // the TaskFragmentContainers need to be updated when the task becomes visible
            taskContainer.mTaskFragmentContainersNeedsUpdate = true;
        }
    }

    @GuardedBy("mLock")
    private void updateContainersInTask(@NonNull WindowContainerTransaction wct,
            @NonNull TaskContainer taskContainer) {
        taskContainer.mTaskFragmentContainersNeedsUpdate = false;

        // Update all TaskFragments in the Task. Make a copy of the list since some may be
        // removed on updating.
        final List<TaskFragmentContainer> containers = taskContainer.getTaskFragmentContainers();
+8 −1
Original line number Diff line number Diff line
@@ -107,6 +107,12 @@ class TaskContainer {
     */
    private boolean mPlaceholderRuleSuppressed;

    /**
     * {@code true} if the TaskFragments in this Task needs to be updated next time the Task
     * becomes visible. See {@link #shouldUpdateContainer(TaskFragmentParentInfo)}
     */
    boolean mTaskFragmentContainersNeedsUpdate;

    /**
     * The {@link TaskContainer} constructor
     *
@@ -185,7 +191,8 @@ class TaskContainer {

        // If the task properties equals regardless of starting position, don't
        // need to update the container.
        return mInfo.getConfiguration().diffPublicOnly(configuration) != 0
        return mTaskFragmentContainersNeedsUpdate
                || mInfo.getConfiguration().diffPublicOnly(configuration) != 0
                || mInfo.getDisplayId() != info.getDisplayId();
    }