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

Commit 4e9d54ed authored by Garfield Tan's avatar Garfield Tan Committed by Android (Google) Code Review
Browse files

Merge "Add task visibility to TaskInfo."

parents 77b8fd6a 42767054
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -214,7 +214,6 @@ public class TaskInfo {
     */
    public int parentTaskId;


    /**
     * Parent bounds.
     * @hide
@@ -227,6 +226,12 @@ public class TaskInfo {
     */
    public boolean isFocused;

    /**
     * Whether this task is visible.
     * @hide
     */
    public boolean isVisible;

    TaskInfo() {
        // Do nothing
    }
@@ -311,7 +316,8 @@ public class TaskInfo {
                && pictureInPictureParams == that.pictureInPictureParams
                && getWindowingMode() == that.getWindowingMode()
                && Objects.equals(taskDescription, that.taskDescription)
                && isFocused == that.isFocused;
                && isFocused == that.isFocused
                && isVisible == that.isVisible;
    }

    private boolean equalsLetterboxParams(TaskInfo that) {
@@ -358,6 +364,7 @@ public class TaskInfo {
        parentTaskId = source.readInt();
        parentBounds = source.readTypedObject(Rect.CREATOR);
        isFocused = source.readBoolean();
        isVisible = source.readBoolean();
    }

    /**
@@ -394,6 +401,7 @@ public class TaskInfo {
        dest.writeInt(parentTaskId);
        dest.writeTypedObject(parentBounds, flags);
        dest.writeBoolean(isFocused);
        dest.writeBoolean(isVisible);
    }

    @Override
@@ -413,12 +421,13 @@ public class TaskInfo {
                + " topActivityType=" + topActivityType
                + " pictureInPictureParams=" + pictureInPictureParams
                + " topActivityInfo=" + topActivityInfo
                + " launchCookies" + launchCookies
                + " launchCookies=" + launchCookies
                + " letterboxActivityBounds=" + letterboxActivityBounds
                + " positionInParent=" + positionInParent
                + " parentTaskId=" + parentTaskId
                + " parentBounds=" + parentBounds
                + " isFocused=" + isFocused
                + " isVisible=" + isVisible
                + "}";
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -4099,6 +4099,7 @@ class Task extends WindowContainer<WindowContainer> {
                ? rootTask.mTaskId
                : INVALID_TASK_ID;
        info.isFocused = isFocused();
        info.isVisible = hasVisibleChildren();
    }

    @Nullable PictureInPictureParams getPictureInPictureParams() {
@@ -5764,6 +5765,10 @@ class Task extends WindowContainer<WindowContainer> {
                    starting, configChanges, preserveWindows, notifyClients, userLeaving),
                    true /* traverseTopToBottom */);

            // Notify WM shell that task visibilities may have changed
            forAllTasks(task -> task.dispatchTaskInfoChangedIfNeeded(/* force */ false),
                    true /* traverseTopToBottom */);

            if (mTranslucentActivityWaiting != null &&
                    mUndrawnActivitiesBelowTopTranslucent.isEmpty()) {
                // Nothing is getting drawn or everything was already visible, don't wait for