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

Commit f47d2b7b authored by Jorge Gil's avatar Jorge Gil
Browse files

Add requestedVisibleTypes to TaskInfo

To allow Shell to know the inset types requested by each window/task
instead of the global aggregate available through InsetsState. This will
enable showing additional maximize/immersive UI affordances in the
caption bar depending on whether a specific window is requesting
immersive mode or not.

Flag: com.android.window.flags.enable_fully_immersive_in_desktop
Bug: 369388861
Test: m
Change-Id: I62a58b9c3d5623d4af977375e92bef86ede192b9
parent e94b365d
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.os.Build;
import android.os.IBinder;
import android.os.Parcel;
import android.view.DisplayCutout;
import android.view.WindowInsets;
import android.window.WindowContainerToken;

import java.util.ArrayList;
@@ -328,6 +329,13 @@ public class TaskInfo {
     */
    public long capturedLinkTimestamp;

    /**
     * The requested visible types of insets.
     * @hide
     */
    @WindowInsets.Type.InsetsType
    public int requestedVisibleTypes;

    /**
     * Encapsulate specific App Compat information.
     * @hide
@@ -465,6 +473,7 @@ public class TaskInfo {
                && lastNonFullscreenBounds == this.lastNonFullscreenBounds
                && Objects.equals(capturedLink, that.capturedLink)
                && capturedLinkTimestamp == that.capturedLinkTimestamp
                && requestedVisibleTypes == that.requestedVisibleTypes
                && appCompatTaskInfo.equalsForTaskOrganizer(that.appCompatTaskInfo);
    }

@@ -539,6 +548,7 @@ public class TaskInfo {
        lastNonFullscreenBounds = source.readTypedObject(Rect.CREATOR);
        capturedLink = source.readTypedObject(Uri.CREATOR);
        capturedLinkTimestamp = source.readLong();
        requestedVisibleTypes = source.readInt();
        appCompatTaskInfo = source.readTypedObject(AppCompatTaskInfo.CREATOR);
    }

@@ -591,6 +601,7 @@ public class TaskInfo {
        dest.writeTypedObject(lastNonFullscreenBounds, flags);
        dest.writeTypedObject(capturedLink, flags);
        dest.writeLong(capturedLinkTimestamp);
        dest.writeInt(requestedVisibleTypes);
        dest.writeTypedObject(appCompatTaskInfo, flags);
    }

@@ -633,6 +644,7 @@ public class TaskInfo {
                + " lastNonFullscreenBounds=" + lastNonFullscreenBounds
                + " capturedLink=" + capturedLink
                + " capturedLinkTimestamp=" + capturedLinkTimestamp
                + " requestedVisibleTypes=" + requestedVisibleTypes
                + " appCompatTaskInfo=" + appCompatTaskInfo
                + "}";
    }
+4 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ import android.view.DisplayInfo;
import android.view.InsetsState;
import android.view.RemoteAnimationAdapter;
import android.view.SurfaceControl;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.window.ITaskOrganizer;
import android.window.PictureInPictureSurfaceTransaction;
@@ -3399,6 +3400,9 @@ class Task extends TaskFragment {
        info.isTopActivityTransparent = top != null && !top.fillsParent();
        info.isTopActivityStyleFloating = top != null && top.isStyleFloating();
        info.lastNonFullscreenBounds = topTask.mLastNonFullscreenBounds;
        final WindowState windowState = top != null ? top.findMainWindow() : null;
        info.requestedVisibleTypes = (windowState != null && Flags.enableFullyImmersiveInDesktop())
                ? windowState.getRequestedVisibleTypes() : WindowInsets.Type.defaultVisible();
        AppCompatUtils.fillAppCompatTaskInfo(this, info, top);
    }