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

Commit 42767054 authored by Garfield Tan's avatar Garfield Tan
Browse files

Add task visibility to TaskInfo.

Bug: 165794880
Test: Task visibility is pushed to WM shell.
Change-Id: If518a72c658ffe55b60c82afadfc92b1e7bd2738
parent 649ed103
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