Loading core/java/android/app/TaskInfo.java +41 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.window.DisplayAreaOrganizer.FEATURE_UNDEFINED; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; Loading Loading @@ -53,6 +54,46 @@ public class TaskInfo { */ public static final int PROPERTY_VALUE_UNSET = -1; /** * Self-movable state is not set. * * @hide */ public static final int SELF_MOVABLE_UNSET = -1; /** * Self-movable state is not defined. WM core uses freeform windowing mode to decide. * * @hide */ public static final int SELF_MOVABLE_DEFAULT = 0; /** * Self-moving is allowed. Note that there are permission checks in addition to this flag for * apps calling {@link android.app.ActivityManager.AppTask#moveTaskToFront}. * * @hide */ public static final int SELF_MOVABLE_ALLOWED = 1; /** * Self-moving is denied. * * @hide */ public static final int SELF_MOVABLE_DENIED = 2; /** @hide */ @IntDef( prefix = {"SELF_MOVABLE_"}, value = { SELF_MOVABLE_UNSET, SELF_MOVABLE_DEFAULT, SELF_MOVABLE_ALLOWED, SELF_MOVABLE_DENIED, }) public @interface SelfMovable {} /** * The id of the user the task was running as if this is a leaf task. The id of the current * running user of the system otherwise. Loading core/java/android/window/WindowContainerTransaction.java +77 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.window; import static android.app.Instrumentation.DEBUG_START_ACTIVITY; import static android.app.TaskInfo.SELF_MOVABLE_UNSET; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.window.TaskFragmentOperation.OP_TYPE_CLEAR_ADJACENT_TASK_FRAGMENTS; import static android.window.TaskFragmentOperation.OP_TYPE_CREATE_TASK_FRAGMENT; Loading @@ -35,6 +36,7 @@ import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.Instrumentation; import android.app.PendingIntent; import android.app.TaskInfo.SelfMovable; import android.app.WindowConfiguration; import android.app.WindowConfiguration.WindowingMode; import android.content.Intent; Loading Loading @@ -518,6 +520,47 @@ public final class WindowContainerTransaction implements Parcelable { return this; } /** * Sets whether the given container can be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. * Note that there are additional permission checks for the caller of {@link * android.app.ActivityManager.AppTask#moveTaskTo}. * * @param container The window container of the task that the self-movable state is set on. * @param selfMovable {@link android.app.TaskInfo#SELF_MOVABLE_ALLOWED} or {@link * android.app.TaskInfo#SELF_MOVABLE_DENIED} to set the task as self-movable or not, {@link * android.app.TaskInfo#SELF_MOVABLE_DEFAULT} to let the WM Core decide. * @hide */ @NonNull public WindowContainerTransaction setSelfMovable( @NonNull WindowContainerToken container, @SelfMovable int selfMovable) { final Change change = getOrCreateChange(container.asBinder()); change.mSelfMovable = selfMovable; return this; } /** * Sets whether the given container is able to contain self-movable tasks. A display is * considered able to contain self-movable tasks as long as there is one child window container * that is able to contain self-movable tasks. * * <p>Initially after each boot-up no window containers can contain self-movable tasks. * * @param container The window container whose ability to contain self-movable tasks is set on. * @param isTaskMoveAllowed {@code true} to allow containing self-movable tasks, {@code * false} otherwise. * @hide */ @NonNull public WindowContainerTransaction setIsTaskMoveAllowed( @NonNull WindowContainerToken container, boolean isTaskMoveAllowed) { final Change change = getOrCreateChange(container.asBinder()); change.mChangeMask |= Change.CHANGE_IS_TASK_MOVE_ALLOWED; change.mIsTaskMoveAllowed = isTaskMoveAllowed; return this; } /* * =========================================================================================== * Hierarchy updates (create/destroy/reorder/reparent containers) Loading Loading @@ -1381,6 +1424,7 @@ public final class WindowContainerTransaction implements Parcelable { public static final int CHANGE_LAUNCH_NEXT_TO_BUBBLE = 1 << 10; public static final int CHANGE_DISABLE_PIP = 1 << 11; public static final int CHANGE_DISABLE_LAUNCH_ADJACENT = 1 << 12; public static final int CHANGE_IS_TASK_MOVE_ALLOWED = 1 << 13; @IntDef(flag = true, prefix = { "CHANGE_" }, value = { CHANGE_FOCUSABLE, Loading @@ -1396,6 +1440,7 @@ public final class WindowContainerTransaction implements Parcelable { CHANGE_LAUNCH_NEXT_TO_BUBBLE, CHANGE_DISABLE_PIP, CHANGE_DISABLE_LAUNCH_ADJACENT, CHANGE_IS_TASK_MOVE_ALLOWED, }) @Retention(RetentionPolicy.SOURCE) public @interface ChangeMask {} Loading @@ -1409,6 +1454,7 @@ public final class WindowContainerTransaction implements Parcelable { private boolean mForceExcludedFromRecents = false; private boolean mDisablePip = false; private boolean mDisableLaunchAdjacent = false; private boolean mIsTaskMoveAllowed = false; private @ChangeMask int mChangeMask = 0; private @ActivityInfo.Config int mConfigSetMask = 0; Loading @@ -1421,6 +1467,7 @@ public final class WindowContainerTransaction implements Parcelable { private int mActivityWindowingMode = -1; private int mWindowingMode = -1; private @SelfMovable int mSelfMovable = SELF_MOVABLE_UNSET; private boolean mLaunchNextToBubble = false; Loading @@ -1437,6 +1484,7 @@ public final class WindowContainerTransaction implements Parcelable { mLaunchNextToBubble = in.readBoolean(); mDisablePip = in.readBoolean(); mDisableLaunchAdjacent = in.readBoolean(); mIsTaskMoveAllowed = in.readBoolean(); mChangeMask = in.readInt(); mConfigSetMask = in.readInt(); mWindowSetMask = in.readInt(); Loading @@ -1452,6 +1500,7 @@ public final class WindowContainerTransaction implements Parcelable { mWindowingMode = in.readInt(); mActivityWindowingMode = in.readInt(); mSelfMovable = in.readInt(); } /** Loading Loading @@ -1494,6 +1543,9 @@ public final class WindowContainerTransaction implements Parcelable { if ((other.mChangeMask & CHANGE_DISABLE_LAUNCH_ADJACENT) != 0) { mDisableLaunchAdjacent = other.mDisableLaunchAdjacent; } if ((other.mChangeMask & CHANGE_IS_TASK_MOVE_ALLOWED) != 0) { mIsTaskMoveAllowed = other.mIsTaskMoveAllowed; } mChangeMask |= other.mChangeMask; if (other.mActivityWindowingMode >= WINDOWING_MODE_UNDEFINED) { mActivityWindowingMode = other.mActivityWindowingMode; Loading @@ -1501,6 +1553,9 @@ public final class WindowContainerTransaction implements Parcelable { if (other.mWindowingMode >= WINDOWING_MODE_UNDEFINED) { mWindowingMode = other.mWindowingMode; } if (other.mSelfMovable != SELF_MOVABLE_UNSET) { mSelfMovable = other.mSelfMovable; } if (other.mRelativeBounds != null) { mRelativeBounds = transfer ? other.mRelativeBounds Loading Loading @@ -1602,6 +1657,23 @@ public final class WindowContainerTransaction implements Parcelable { return mConfigAtTransitionEnd; } /** * Gets whether the given container can be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. */ public @SelfMovable int getSelfMovable() { return mSelfMovable; } /** * Gets whether the given container is able to contain self-movable tasks. A display * is considered able to contain self-movable tasks as long as there is one child window * container that is able to contain self-movable tasks. */ public boolean getIsTaskMoveAllowed() { return mIsTaskMoveAllowed; } @ChangeMask public int getChangeMask() { return mChangeMask; Loading Loading @@ -1676,6 +1748,9 @@ public final class WindowContainerTransaction implements Parcelable { if ((mChangeMask & CHANGE_DISABLE_LAUNCH_ADJACENT) != 0) { sb.append("disableLaunchAdjacent:" + mDisableLaunchAdjacent + ","); } if ((mChangeMask & CHANGE_IS_TASK_MOVE_ALLOWED) != 0) { sb.append("isTaskMoveAllowed:" + mIsTaskMoveAllowed + ","); } if (mBoundsChangeTransaction != null) { sb.append("hasBoundsTransaction,"); } Loading Loading @@ -1707,6 +1782,7 @@ public final class WindowContainerTransaction implements Parcelable { dest.writeBoolean(mLaunchNextToBubble); dest.writeBoolean(mDisablePip); dest.writeBoolean(mDisableLaunchAdjacent); dest.writeBoolean(mIsTaskMoveAllowed); dest.writeInt(mChangeMask); dest.writeInt(mConfigSetMask); dest.writeInt(mWindowSetMask); Loading @@ -1721,6 +1797,7 @@ public final class WindowContainerTransaction implements Parcelable { dest.writeInt(mWindowingMode); dest.writeInt(mActivityWindowingMode); dest.writeInt(mSelfMovable); } @Override Loading services/core/java/com/android/server/wm/Task.java +24 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ import android.app.AppGlobals; import android.app.IActivityController; import android.app.PictureInPictureParams; import android.app.TaskInfo; import android.app.TaskInfo.SelfMovable; import android.app.WindowConfiguration; import android.content.ComponentName; import android.content.Intent; Loading Loading @@ -527,6 +528,12 @@ class Task extends TaskFragment { */ private boolean mForceNonResizeOverride; /** * If the window is allowed to be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. */ private @SelfMovable int mSelfMovable = TaskInfo.SELF_MOVABLE_DEFAULT; private static final int TRANSLUCENT_TIMEOUT_MSG = FIRST_ACTIVITY_TASK_MSG + 1; private final Handler mHandler; Loading Loading @@ -3856,6 +3863,7 @@ class Task extends TaskFragment { if (mReparentLeafTaskIfRelaunch) { pw.println(prefix + "mReparentLeafTaskIfRelaunch=true"); } pw.println(prefix + "mSelfMovable=" + mSelfMovable); } @Override Loading Loading @@ -6405,6 +6413,22 @@ class Task extends TaskFragment { || (mRequiredDisplayCategory == null && info.requiredDisplayCategory == null); } /** * Sets whether the window is allowed to be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. */ void setSelfMovable(@SelfMovable int selfMovable) { mSelfMovable = selfMovable; } /** * Gets whether the window is allowed to be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. */ @SelfMovable int getSelfMovable() { return mSelfMovable; } @Override public void dumpDebug(ProtoOutputStream proto, long fieldId, @WindowTracingLogLevel int logLevel) { Loading services/core/java/com/android/server/wm/WindowContainer.java +15 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,12 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< */ RemoteToken mRemoteToken = null; /** * This indicates whether this Container can hold tasks that can be repositioned on screen * using the {@link android.app.ActivityManager.AppTask#moveTaskTo} method. */ private boolean mIsTaskMoveAllowed = false; /** This isn't participating in a sync. */ public static final int SYNC_STATE_NONE = 0; Loading Loading @@ -3248,6 +3254,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< if (mSafeRegionBounds != null) { pw.println(prefix + "mSafeRegionBounds=" + mSafeRegionBounds); } pw.println(prefix + "mIsTaskMoveAllowed=" + mIsTaskMoveAllowed); } final void updateSurfacePositionNonOrganized() { Loading Loading @@ -3901,4 +3908,12 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< int getSyncTransactionCommitCallbackDepth() { return mSyncTransactionCommitCallbackDepth; } void setIsTaskMoveAllowed(boolean isTaskMoveAllowed) { mIsTaskMoveAllowed = isTaskMoveAllowed; } boolean getIsTaskMoveAllowed() { return mIsTaskMoveAllowed; } } services/core/java/com/android/server/wm/WindowOrganizerController.java +10 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.wm; import static android.Manifest.permission.START_TASKS_FROM_RECENTS; import static android.app.ActivityManager.isStartResultSuccessful; import static android.app.TaskInfo.SELF_MOVABLE_UNSET; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; Loading Loading @@ -876,6 +877,11 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub } } if ((change.getChangeMask() & WindowContainerTransaction.Change.CHANGE_IS_TASK_MOVE_ALLOWED) != 0) { container.setIsTaskMoveAllowed(change.getIsTaskMoveAllowed()); } if (windowingMode > -1) { if (mService.isInLockTaskMode() && WindowConfiguration.inMultiWindowMode(windowingMode) Loading Loading @@ -998,6 +1004,10 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub } } if (c.getSelfMovable() != SELF_MOVABLE_UNSET) { tr.setSelfMovable(c.getSelfMovable()); } return effects; } Loading Loading
core/java/android/app/TaskInfo.java +41 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.window.DisplayAreaOrganizer.FEATURE_UNDEFINED; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; Loading Loading @@ -53,6 +54,46 @@ public class TaskInfo { */ public static final int PROPERTY_VALUE_UNSET = -1; /** * Self-movable state is not set. * * @hide */ public static final int SELF_MOVABLE_UNSET = -1; /** * Self-movable state is not defined. WM core uses freeform windowing mode to decide. * * @hide */ public static final int SELF_MOVABLE_DEFAULT = 0; /** * Self-moving is allowed. Note that there are permission checks in addition to this flag for * apps calling {@link android.app.ActivityManager.AppTask#moveTaskToFront}. * * @hide */ public static final int SELF_MOVABLE_ALLOWED = 1; /** * Self-moving is denied. * * @hide */ public static final int SELF_MOVABLE_DENIED = 2; /** @hide */ @IntDef( prefix = {"SELF_MOVABLE_"}, value = { SELF_MOVABLE_UNSET, SELF_MOVABLE_DEFAULT, SELF_MOVABLE_ALLOWED, SELF_MOVABLE_DENIED, }) public @interface SelfMovable {} /** * The id of the user the task was running as if this is a leaf task. The id of the current * running user of the system otherwise. Loading
core/java/android/window/WindowContainerTransaction.java +77 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.window; import static android.app.Instrumentation.DEBUG_START_ACTIVITY; import static android.app.TaskInfo.SELF_MOVABLE_UNSET; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.window.TaskFragmentOperation.OP_TYPE_CLEAR_ADJACENT_TASK_FRAGMENTS; import static android.window.TaskFragmentOperation.OP_TYPE_CREATE_TASK_FRAGMENT; Loading @@ -35,6 +36,7 @@ import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.Instrumentation; import android.app.PendingIntent; import android.app.TaskInfo.SelfMovable; import android.app.WindowConfiguration; import android.app.WindowConfiguration.WindowingMode; import android.content.Intent; Loading Loading @@ -518,6 +520,47 @@ public final class WindowContainerTransaction implements Parcelable { return this; } /** * Sets whether the given container can be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. * Note that there are additional permission checks for the caller of {@link * android.app.ActivityManager.AppTask#moveTaskTo}. * * @param container The window container of the task that the self-movable state is set on. * @param selfMovable {@link android.app.TaskInfo#SELF_MOVABLE_ALLOWED} or {@link * android.app.TaskInfo#SELF_MOVABLE_DENIED} to set the task as self-movable or not, {@link * android.app.TaskInfo#SELF_MOVABLE_DEFAULT} to let the WM Core decide. * @hide */ @NonNull public WindowContainerTransaction setSelfMovable( @NonNull WindowContainerToken container, @SelfMovable int selfMovable) { final Change change = getOrCreateChange(container.asBinder()); change.mSelfMovable = selfMovable; return this; } /** * Sets whether the given container is able to contain self-movable tasks. A display is * considered able to contain self-movable tasks as long as there is one child window container * that is able to contain self-movable tasks. * * <p>Initially after each boot-up no window containers can contain self-movable tasks. * * @param container The window container whose ability to contain self-movable tasks is set on. * @param isTaskMoveAllowed {@code true} to allow containing self-movable tasks, {@code * false} otherwise. * @hide */ @NonNull public WindowContainerTransaction setIsTaskMoveAllowed( @NonNull WindowContainerToken container, boolean isTaskMoveAllowed) { final Change change = getOrCreateChange(container.asBinder()); change.mChangeMask |= Change.CHANGE_IS_TASK_MOVE_ALLOWED; change.mIsTaskMoveAllowed = isTaskMoveAllowed; return this; } /* * =========================================================================================== * Hierarchy updates (create/destroy/reorder/reparent containers) Loading Loading @@ -1381,6 +1424,7 @@ public final class WindowContainerTransaction implements Parcelable { public static final int CHANGE_LAUNCH_NEXT_TO_BUBBLE = 1 << 10; public static final int CHANGE_DISABLE_PIP = 1 << 11; public static final int CHANGE_DISABLE_LAUNCH_ADJACENT = 1 << 12; public static final int CHANGE_IS_TASK_MOVE_ALLOWED = 1 << 13; @IntDef(flag = true, prefix = { "CHANGE_" }, value = { CHANGE_FOCUSABLE, Loading @@ -1396,6 +1440,7 @@ public final class WindowContainerTransaction implements Parcelable { CHANGE_LAUNCH_NEXT_TO_BUBBLE, CHANGE_DISABLE_PIP, CHANGE_DISABLE_LAUNCH_ADJACENT, CHANGE_IS_TASK_MOVE_ALLOWED, }) @Retention(RetentionPolicy.SOURCE) public @interface ChangeMask {} Loading @@ -1409,6 +1454,7 @@ public final class WindowContainerTransaction implements Parcelable { private boolean mForceExcludedFromRecents = false; private boolean mDisablePip = false; private boolean mDisableLaunchAdjacent = false; private boolean mIsTaskMoveAllowed = false; private @ChangeMask int mChangeMask = 0; private @ActivityInfo.Config int mConfigSetMask = 0; Loading @@ -1421,6 +1467,7 @@ public final class WindowContainerTransaction implements Parcelable { private int mActivityWindowingMode = -1; private int mWindowingMode = -1; private @SelfMovable int mSelfMovable = SELF_MOVABLE_UNSET; private boolean mLaunchNextToBubble = false; Loading @@ -1437,6 +1484,7 @@ public final class WindowContainerTransaction implements Parcelable { mLaunchNextToBubble = in.readBoolean(); mDisablePip = in.readBoolean(); mDisableLaunchAdjacent = in.readBoolean(); mIsTaskMoveAllowed = in.readBoolean(); mChangeMask = in.readInt(); mConfigSetMask = in.readInt(); mWindowSetMask = in.readInt(); Loading @@ -1452,6 +1500,7 @@ public final class WindowContainerTransaction implements Parcelable { mWindowingMode = in.readInt(); mActivityWindowingMode = in.readInt(); mSelfMovable = in.readInt(); } /** Loading Loading @@ -1494,6 +1543,9 @@ public final class WindowContainerTransaction implements Parcelable { if ((other.mChangeMask & CHANGE_DISABLE_LAUNCH_ADJACENT) != 0) { mDisableLaunchAdjacent = other.mDisableLaunchAdjacent; } if ((other.mChangeMask & CHANGE_IS_TASK_MOVE_ALLOWED) != 0) { mIsTaskMoveAllowed = other.mIsTaskMoveAllowed; } mChangeMask |= other.mChangeMask; if (other.mActivityWindowingMode >= WINDOWING_MODE_UNDEFINED) { mActivityWindowingMode = other.mActivityWindowingMode; Loading @@ -1501,6 +1553,9 @@ public final class WindowContainerTransaction implements Parcelable { if (other.mWindowingMode >= WINDOWING_MODE_UNDEFINED) { mWindowingMode = other.mWindowingMode; } if (other.mSelfMovable != SELF_MOVABLE_UNSET) { mSelfMovable = other.mSelfMovable; } if (other.mRelativeBounds != null) { mRelativeBounds = transfer ? other.mRelativeBounds Loading Loading @@ -1602,6 +1657,23 @@ public final class WindowContainerTransaction implements Parcelable { return mConfigAtTransitionEnd; } /** * Gets whether the given container can be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. */ public @SelfMovable int getSelfMovable() { return mSelfMovable; } /** * Gets whether the given container is able to contain self-movable tasks. A display * is considered able to contain self-movable tasks as long as there is one child window * container that is able to contain self-movable tasks. */ public boolean getIsTaskMoveAllowed() { return mIsTaskMoveAllowed; } @ChangeMask public int getChangeMask() { return mChangeMask; Loading Loading @@ -1676,6 +1748,9 @@ public final class WindowContainerTransaction implements Parcelable { if ((mChangeMask & CHANGE_DISABLE_LAUNCH_ADJACENT) != 0) { sb.append("disableLaunchAdjacent:" + mDisableLaunchAdjacent + ","); } if ((mChangeMask & CHANGE_IS_TASK_MOVE_ALLOWED) != 0) { sb.append("isTaskMoveAllowed:" + mIsTaskMoveAllowed + ","); } if (mBoundsChangeTransaction != null) { sb.append("hasBoundsTransaction,"); } Loading Loading @@ -1707,6 +1782,7 @@ public final class WindowContainerTransaction implements Parcelable { dest.writeBoolean(mLaunchNextToBubble); dest.writeBoolean(mDisablePip); dest.writeBoolean(mDisableLaunchAdjacent); dest.writeBoolean(mIsTaskMoveAllowed); dest.writeInt(mChangeMask); dest.writeInt(mConfigSetMask); dest.writeInt(mWindowSetMask); Loading @@ -1721,6 +1797,7 @@ public final class WindowContainerTransaction implements Parcelable { dest.writeInt(mWindowingMode); dest.writeInt(mActivityWindowingMode); dest.writeInt(mSelfMovable); } @Override Loading
services/core/java/com/android/server/wm/Task.java +24 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,7 @@ import android.app.AppGlobals; import android.app.IActivityController; import android.app.PictureInPictureParams; import android.app.TaskInfo; import android.app.TaskInfo.SelfMovable; import android.app.WindowConfiguration; import android.content.ComponentName; import android.content.Intent; Loading Loading @@ -527,6 +528,12 @@ class Task extends TaskFragment { */ private boolean mForceNonResizeOverride; /** * If the window is allowed to be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. */ private @SelfMovable int mSelfMovable = TaskInfo.SELF_MOVABLE_DEFAULT; private static final int TRANSLUCENT_TIMEOUT_MSG = FIRST_ACTIVITY_TASK_MSG + 1; private final Handler mHandler; Loading Loading @@ -3856,6 +3863,7 @@ class Task extends TaskFragment { if (mReparentLeafTaskIfRelaunch) { pw.println(prefix + "mReparentLeafTaskIfRelaunch=true"); } pw.println(prefix + "mSelfMovable=" + mSelfMovable); } @Override Loading Loading @@ -6405,6 +6413,22 @@ class Task extends TaskFragment { || (mRequiredDisplayCategory == null && info.requiredDisplayCategory == null); } /** * Sets whether the window is allowed to be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. */ void setSelfMovable(@SelfMovable int selfMovable) { mSelfMovable = selfMovable; } /** * Gets whether the window is allowed to be repositioned by {@link * android.app.ActivityManager.AppTask#moveTaskTo}. */ @SelfMovable int getSelfMovable() { return mSelfMovable; } @Override public void dumpDebug(ProtoOutputStream proto, long fieldId, @WindowTracingLogLevel int logLevel) { Loading
services/core/java/com/android/server/wm/WindowContainer.java +15 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,12 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< */ RemoteToken mRemoteToken = null; /** * This indicates whether this Container can hold tasks that can be repositioned on screen * using the {@link android.app.ActivityManager.AppTask#moveTaskTo} method. */ private boolean mIsTaskMoveAllowed = false; /** This isn't participating in a sync. */ public static final int SYNC_STATE_NONE = 0; Loading Loading @@ -3248,6 +3254,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< if (mSafeRegionBounds != null) { pw.println(prefix + "mSafeRegionBounds=" + mSafeRegionBounds); } pw.println(prefix + "mIsTaskMoveAllowed=" + mIsTaskMoveAllowed); } final void updateSurfacePositionNonOrganized() { Loading Loading @@ -3901,4 +3908,12 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< int getSyncTransactionCommitCallbackDepth() { return mSyncTransactionCommitCallbackDepth; } void setIsTaskMoveAllowed(boolean isTaskMoveAllowed) { mIsTaskMoveAllowed = isTaskMoveAllowed; } boolean getIsTaskMoveAllowed() { return mIsTaskMoveAllowed; } }
services/core/java/com/android/server/wm/WindowOrganizerController.java +10 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.wm; import static android.Manifest.permission.START_TASKS_FROM_RECENTS; import static android.app.ActivityManager.isStartResultSuccessful; import static android.app.TaskInfo.SELF_MOVABLE_UNSET; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; Loading Loading @@ -876,6 +877,11 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub } } if ((change.getChangeMask() & WindowContainerTransaction.Change.CHANGE_IS_TASK_MOVE_ALLOWED) != 0) { container.setIsTaskMoveAllowed(change.getIsTaskMoveAllowed()); } if (windowingMode > -1) { if (mService.isInLockTaskMode() && WindowConfiguration.inMultiWindowMode(windowingMode) Loading Loading @@ -998,6 +1004,10 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub } } if (c.getSelfMovable() != SELF_MOVABLE_UNSET) { tr.setSelfMovable(c.getSelfMovable()); } return effects; } Loading