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

Commit 6ccfb632 authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas
Browse files

Expose `Task#mLastNonFullscreenBounds` to Shell via TaskInfo

For cascading in desktop windowing, the initial bounds of the activity
are needed to be able to adjust their position but maintain the correct
size. Since the initial bounds are no longer calculated in Shell, we
we need a way of accessing the bounds calculated by Core.

The bounds calculated by core are always stored in
`Task#mLastNonFullscreenBound`. So we will add
`Task#mLastNonFullscreenBounds` to the `TaskInfo` so the correct bounds
can be accessed by Shell if and when needed.

Flag: EXEMPT adding variable
Test: Presubmit
Fixes: 355401868
Change-Id: Ib8bf1b40dcfecb9b0a92a95eda7593a7d6709f81
parent 11696d45
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -303,6 +303,12 @@ public class TaskInfo {
     */
    public boolean isTopActivityStyleFloating;

    /**
     * The last non-fullscreen bounds the task was launched in or resized to.
     * @hide
     */
    public Rect lastNonFullscreenBounds;

    /**
     * The URI of the intent that generated the top-most activity opened using a URL.
     * @hide
@@ -450,6 +456,7 @@ public class TaskInfo {
                && Objects.equals(topActivity, that.topActivity)
                && isTopActivityTransparent == that.isTopActivityTransparent
                && isTopActivityStyleFloating == that.isTopActivityStyleFloating
                && lastNonFullscreenBounds == this.lastNonFullscreenBounds
                && Objects.equals(capturedLink, that.capturedLink)
                && capturedLinkTimestamp == that.capturedLinkTimestamp
                && appCompatTaskInfo.equalsForTaskOrganizer(that.appCompatTaskInfo);
@@ -522,6 +529,7 @@ public class TaskInfo {
        displayAreaFeatureId = source.readInt();
        isTopActivityTransparent = source.readBoolean();
        isTopActivityStyleFloating = source.readBoolean();
        lastNonFullscreenBounds = source.readTypedObject(Rect.CREATOR);
        capturedLink = source.readTypedObject(Uri.CREATOR);
        capturedLinkTimestamp = source.readLong();
        appCompatTaskInfo = source.readTypedObject(AppCompatTaskInfo.CREATOR);
@@ -572,6 +580,7 @@ public class TaskInfo {
        dest.writeInt(displayAreaFeatureId);
        dest.writeBoolean(isTopActivityTransparent);
        dest.writeBoolean(isTopActivityStyleFloating);
        dest.writeTypedObject(lastNonFullscreenBounds, flags);
        dest.writeTypedObject(capturedLink, flags);
        dest.writeLong(capturedLinkTimestamp);
        dest.writeTypedObject(appCompatTaskInfo, flags);
@@ -612,6 +621,7 @@ public class TaskInfo {
                + " displayAreaFeatureId=" + displayAreaFeatureId
                + " isTopActivityTransparent=" + isTopActivityTransparent
                + " isTopActivityStyleFloating=" + isTopActivityStyleFloating
                + " lastNonFullscreenBounds=" + lastNonFullscreenBounds
                + " capturedLink=" + capturedLink
                + " capturedLinkTimestamp=" + capturedLinkTimestamp
                + " appCompatTaskInfo=" + appCompatTaskInfo
+1 −0
Original line number Diff line number Diff line
@@ -3415,6 +3415,7 @@ class Task extends TaskFragment {
        info.isSleeping = shouldSleepActivities();
        info.isTopActivityTransparent = top != null && !top.fillsParent();
        info.isTopActivityStyleFloating = top != null && top.isStyleFloating();
        info.lastNonFullscreenBounds = topTask.mLastNonFullscreenBounds;
        appCompatTaskInfo.topActivityLetterboxVerticalPosition = TaskInfo.PROPERTY_VALUE_UNSET;
        appCompatTaskInfo.topActivityLetterboxHorizontalPosition = TaskInfo.PROPERTY_VALUE_UNSET;
        appCompatTaskInfo.topActivityLetterboxWidth = TaskInfo.PROPERTY_VALUE_UNSET;