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

Commit f8b94663 authored by jorgegil@google.com's avatar jorgegil@google.com
Browse files

Add minWidth, minHeight and minTaskSize to TaskInfo

Allows OEMs access to this info in order to send resize
requests that comply with the minimal size policies
without having to query state via WMS.

Bug: 176970585
Test: builds
Change-Id: I540e17312b02afd7c4092f32bdf671f473c736cd
parent fcb2dbea
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -218,6 +218,24 @@ public class TaskInfo {
     */
    public boolean isResizeable;

    /**
     * Minimal width of the task when it's resizeable.
     * @hide
     */
    public int minWidth;

    /**
     * Minimal height of the task when it's resizeable.
     * @hide
     */
    public int minHeight;

    /**
     * The default minimal size of the task used when a minWidth or minHeight is not specified.
     * @hide
     */
    public int defaultMinSize;

    /**
     * Relative position of the task's top left corner in the parent container.
     * @hide
@@ -418,6 +436,9 @@ public class TaskInfo {
        displayCutoutInsets = source.readTypedObject(Rect.CREATOR);
        topActivityInfo = source.readTypedObject(ActivityInfo.CREATOR);
        isResizeable = source.readBoolean();
        minWidth = source.readInt();
        minHeight = source.readInt();
        defaultMinSize = source.readInt();
        source.readBinderList(launchCookies);
        positionInParent = source.readTypedObject(Point.CREATOR);
        parentTaskId = source.readInt();
@@ -458,6 +479,9 @@ public class TaskInfo {
        dest.writeTypedObject(displayCutoutInsets, flags);
        dest.writeTypedObject(topActivityInfo, flags);
        dest.writeBoolean(isResizeable);
        dest.writeInt(minWidth);
        dest.writeInt(minHeight);
        dest.writeInt(defaultMinSize);
        dest.writeBinderList(launchCookies);
        dest.writeTypedObject(positionInParent, flags);
        dest.writeInt(parentTaskId);
@@ -483,6 +507,9 @@ public class TaskInfo {
                + " supportsMultiWindow=" + supportsMultiWindow
                + " resizeMode=" + resizeMode
                + " isResizeable=" + isResizeable
                + " minWidth=" + minWidth
                + " minHeight=" + minHeight
                + " defaultMinSize=" + defaultMinSize
                + " token=" + token
                + " topActivityType=" + topActivityType
                + " pictureInPictureParams=" + pictureInPictureParams
+3 −0
Original line number Diff line number Diff line
@@ -3361,6 +3361,9 @@ class Task extends TaskFragment {
        info.resizeMode = top != null ? top.mResizeMode : mResizeMode;
        info.topActivityType = top.getActivityType();
        info.isResizeable = isResizeable();
        info.minWidth = mMinWidth;
        info.minHeight = mMinHeight;
        info.defaultMinSize = mRootWindowContainer.mDefaultMinSizeOfResizeableTaskDp;

        info.positionInParent = getRelativePosition();