Loading core/proto/android/server/activitymanagerservice.proto +3 −1 Original line number Diff line number Diff line Loading @@ -88,13 +88,15 @@ message ActivityDisplayProto { message ActivityStackProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1; // To be removed soon. optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1 [deprecated=true]; optional int32 id = 2; repeated TaskRecordProto tasks = 3; optional .com.android.server.wm.IdentifierProto resumed_activity = 4; optional int32 display_id = 5; optional bool fullscreen = 6; optional .android.graphics.RectProto bounds = 7; optional .com.android.server.wm.StackProto stack = 8; } message TaskRecordProto { Loading services/core/java/com/android/server/wm/ActivityDisplay.java +36 −11 Original line number Diff line number Diff line Loading @@ -123,6 +123,9 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { private boolean mSleeping; /** We started the process of removing the display from the system. */ private boolean mRemoving; /** * The display is removed from the system and we are just waiting for all activities on it to be * finished before removing this object. Loading Loading @@ -200,23 +203,37 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { } } // TODO(display-unify): Merge with addChild below. void addChild(ActivityStack stack, int position) { addChild(stack, position, false /*fromDc*/); } void addChild(ActivityStack stack, int position, boolean fromDc) { boolean toTop = position == POSITION_TOP; if (position == POSITION_BOTTOM) { position = 0; } else if (position == POSITION_TOP) { } else if (toTop) { position = mStacks.size(); } if (DEBUG_STACK) Slog.v(TAG_STACK, "addChild: attaching " + stack + " to displayId=" + mDisplayId + " position=" + position); addStackReferenceIfNeeded(stack); if (!fromDc) { mDisplayContent.setStackOnDisplay(stack, position); } positionChildAt(stack, position); mService.updateSleepIfNeededLocked(); } void removeChild(ActivityStack stack) { // TODO(display-unify): Merge with removeChild below. void onChildRemoved(ActivityStack stack) { if (!mStacks.remove(stack)) { // Stack no longer here! return; } if (DEBUG_STACK) Slog.v(TAG_STACK, "removeChild: detaching " + stack + " from displayId=" + mDisplayId); mStacks.remove(stack); if (mPreferredTopFocusableStack == stack) { mPreferredTopFocusableStack = null; } Loading @@ -226,6 +243,10 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { onStackOrderChanged(stack); } void removeChild(ActivityStack stack) { mDisplayContent.removeStackFromDisplay(stack); } void positionChildAtTop(ActivityStack stack, boolean includingParents) { positionChildAtTop(stack, includingParents, null /* updateLastFocusedStackReason */); } Loading Loading @@ -286,12 +307,8 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { // Since positionChildAt() is called during the creation process of pinned stacks, // ActivityStack#getStack() can be null. if (stack.getTaskStack() != null && mDisplayContent != null) { mDisplayContent.positionStackAt(insertPosition, stack.getTaskStack(), includingParents); } if (!wasContained) { stack.setParent(this); if (mDisplayContent != null) { mDisplayContent.positionStackAt(insertPosition, stack, includingParents); } onStackOrderChanged(stack); } Loading Loading @@ -1186,7 +1203,15 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { return mRemoved; } /** * @see #mRemoving */ boolean isRemoving() { return mRemoving; } void remove() { mRemoving = true; final boolean destroyContentOnRemoval = shouldDestroyContentOnRemove(); ActivityStack lastReparentedStack = null; mPreferredTopFocusableStack = null; Loading @@ -1213,7 +1238,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { final int windowingMode = toDisplay.hasSplitScreenPrimaryStack() ? WINDOWING_MODE_SPLIT_SCREEN_SECONDARY : WINDOWING_MODE_UNDEFINED; stack.reparent(toDisplay, true /* onTop */, true /* displayRemoved */); stack.reparent(toDisplay.mDisplayContent, true /* onTop */); stack.setWindowingMode(windowingMode); lastReparentedStack = stack; } Loading Loading @@ -1251,7 +1276,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { // Release this display if an empty home stack is the only thing left. // Since it is the last stack, this display will be released along with the stack // removal. stack.remove(); stack.removeIfPossible(); } else if (mStacks.isEmpty()) { mDisplayContent.removeIfPossible(); mDisplayContent = null; Loading services/core/java/com/android/server/wm/ActivityRecord.java +9 −7 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.ROTATION_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import static android.app.WindowConfiguration.activityTypeToString; import static android.content.Intent.ACTION_MAIN; Loading Loading @@ -1992,9 +1994,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A /** * @return Stack value from current task, null if there is no task. */ // TODO(stack-unify): Remove once ActivityStack and TaskStack are unified. <T extends ActivityStack> T getActivityStack() { return task != null ? (T) task.getStack() : null; ActivityStack getActivityStack() { return task != null ? task.getStack() : null; } int getStackId() { Loading Loading @@ -2080,10 +2081,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return ActivityInfo.isResizeableMode(info.resizeMode) || info.supportsPictureInPicture(); } /** * @return whether this activity is non-resizeable or forced to be resizeable */ boolean isNonResizableOrForcedResizable() { /** @return whether this activity is non-resizeable or forced to be resizeable */ boolean isNonResizableOrForcedResizable(int windowingMode) { if (windowingMode == WINDOWING_MODE_PINNED && info.supportsPictureInPicture()) { return false; } return info.resizeMode != RESIZE_MODE_RESIZEABLE && info.resizeMode != RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION; } Loading services/core/java/com/android/server/wm/ActivityStack.java +119 −375 File changed.Preview size limit exceeded, changes collapsed. Show changes services/core/java/com/android/server/wm/ActivityStackSupervisor.java +4 −5 Original line number Diff line number Diff line Loading @@ -1713,8 +1713,8 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // another AM call that is holding the AMS lock. In such a case, the pinnedBounds may be // incorrect if AMS.resizeStackWithBoundsFromWindowManager() is already called while waiting // for the AMS lock to be freed. So check and make sure these bounds are still good. final TaskStack stackController = stack.getTaskStack(); if (stackController.pinnedStackResizeDisallowed()) { // TODO(stack-merge): Is this still relevant? if (stack.pinnedStackResizeDisallowed()) { return; } Loading Loading @@ -1893,8 +1893,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { if (currentStack != null) { // Task has already been restored once. Just re-parent it to the new stack. task.reparent(stack.mTaskStack, POSITION_TOP, true /*moveParents*/, "restoreRecentTaskLocked"); task.reparent(stack, POSITION_TOP, true /*moveParents*/, "restoreRecentTaskLocked"); return true; } Loading Loading @@ -2470,7 +2469,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { private void handleForcedResizableTaskIfNeeded(TaskRecord task, int reason) { final ActivityRecord topActivity = task.getTopActivity(); if (topActivity == null || topActivity.noDisplay || !topActivity.isNonResizableOrForcedResizable()) { || !topActivity.isNonResizableOrForcedResizable(task.getWindowingMode())) { return; } mService.getTaskChangeNotificationController().notifyActivityForcedResizable( Loading Loading
core/proto/android/server/activitymanagerservice.proto +3 −1 Original line number Diff line number Diff line Loading @@ -88,13 +88,15 @@ message ActivityDisplayProto { message ActivityStackProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1; // To be removed soon. optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1 [deprecated=true]; optional int32 id = 2; repeated TaskRecordProto tasks = 3; optional .com.android.server.wm.IdentifierProto resumed_activity = 4; optional int32 display_id = 5; optional bool fullscreen = 6; optional .android.graphics.RectProto bounds = 7; optional .com.android.server.wm.StackProto stack = 8; } message TaskRecordProto { Loading
services/core/java/com/android/server/wm/ActivityDisplay.java +36 −11 Original line number Diff line number Diff line Loading @@ -123,6 +123,9 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { private boolean mSleeping; /** We started the process of removing the display from the system. */ private boolean mRemoving; /** * The display is removed from the system and we are just waiting for all activities on it to be * finished before removing this object. Loading Loading @@ -200,23 +203,37 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { } } // TODO(display-unify): Merge with addChild below. void addChild(ActivityStack stack, int position) { addChild(stack, position, false /*fromDc*/); } void addChild(ActivityStack stack, int position, boolean fromDc) { boolean toTop = position == POSITION_TOP; if (position == POSITION_BOTTOM) { position = 0; } else if (position == POSITION_TOP) { } else if (toTop) { position = mStacks.size(); } if (DEBUG_STACK) Slog.v(TAG_STACK, "addChild: attaching " + stack + " to displayId=" + mDisplayId + " position=" + position); addStackReferenceIfNeeded(stack); if (!fromDc) { mDisplayContent.setStackOnDisplay(stack, position); } positionChildAt(stack, position); mService.updateSleepIfNeededLocked(); } void removeChild(ActivityStack stack) { // TODO(display-unify): Merge with removeChild below. void onChildRemoved(ActivityStack stack) { if (!mStacks.remove(stack)) { // Stack no longer here! return; } if (DEBUG_STACK) Slog.v(TAG_STACK, "removeChild: detaching " + stack + " from displayId=" + mDisplayId); mStacks.remove(stack); if (mPreferredTopFocusableStack == stack) { mPreferredTopFocusableStack = null; } Loading @@ -226,6 +243,10 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { onStackOrderChanged(stack); } void removeChild(ActivityStack stack) { mDisplayContent.removeStackFromDisplay(stack); } void positionChildAtTop(ActivityStack stack, boolean includingParents) { positionChildAtTop(stack, includingParents, null /* updateLastFocusedStackReason */); } Loading Loading @@ -286,12 +307,8 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { // Since positionChildAt() is called during the creation process of pinned stacks, // ActivityStack#getStack() can be null. if (stack.getTaskStack() != null && mDisplayContent != null) { mDisplayContent.positionStackAt(insertPosition, stack.getTaskStack(), includingParents); } if (!wasContained) { stack.setParent(this); if (mDisplayContent != null) { mDisplayContent.positionStackAt(insertPosition, stack, includingParents); } onStackOrderChanged(stack); } Loading Loading @@ -1186,7 +1203,15 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { return mRemoved; } /** * @see #mRemoving */ boolean isRemoving() { return mRemoving; } void remove() { mRemoving = true; final boolean destroyContentOnRemoval = shouldDestroyContentOnRemove(); ActivityStack lastReparentedStack = null; mPreferredTopFocusableStack = null; Loading @@ -1213,7 +1238,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { final int windowingMode = toDisplay.hasSplitScreenPrimaryStack() ? WINDOWING_MODE_SPLIT_SCREEN_SECONDARY : WINDOWING_MODE_UNDEFINED; stack.reparent(toDisplay, true /* onTop */, true /* displayRemoved */); stack.reparent(toDisplay.mDisplayContent, true /* onTop */); stack.setWindowingMode(windowingMode); lastReparentedStack = stack; } Loading Loading @@ -1251,7 +1276,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { // Release this display if an empty home stack is the only thing left. // Since it is the last stack, this display will be released along with the stack // removal. stack.remove(); stack.removeIfPossible(); } else if (mStacks.isEmpty()) { mDisplayContent.removeIfPossible(); mDisplayContent = null; Loading
services/core/java/com/android/server/wm/ActivityRecord.java +9 −7 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.ROTATION_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import static android.app.WindowConfiguration.activityTypeToString; import static android.content.Intent.ACTION_MAIN; Loading Loading @@ -1992,9 +1994,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A /** * @return Stack value from current task, null if there is no task. */ // TODO(stack-unify): Remove once ActivityStack and TaskStack are unified. <T extends ActivityStack> T getActivityStack() { return task != null ? (T) task.getStack() : null; ActivityStack getActivityStack() { return task != null ? task.getStack() : null; } int getStackId() { Loading Loading @@ -2080,10 +2081,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return ActivityInfo.isResizeableMode(info.resizeMode) || info.supportsPictureInPicture(); } /** * @return whether this activity is non-resizeable or forced to be resizeable */ boolean isNonResizableOrForcedResizable() { /** @return whether this activity is non-resizeable or forced to be resizeable */ boolean isNonResizableOrForcedResizable(int windowingMode) { if (windowingMode == WINDOWING_MODE_PINNED && info.supportsPictureInPicture()) { return false; } return info.resizeMode != RESIZE_MODE_RESIZEABLE && info.resizeMode != RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION; } Loading
services/core/java/com/android/server/wm/ActivityStack.java +119 −375 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/core/java/com/android/server/wm/ActivityStackSupervisor.java +4 −5 Original line number Diff line number Diff line Loading @@ -1713,8 +1713,8 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // another AM call that is holding the AMS lock. In such a case, the pinnedBounds may be // incorrect if AMS.resizeStackWithBoundsFromWindowManager() is already called while waiting // for the AMS lock to be freed. So check and make sure these bounds are still good. final TaskStack stackController = stack.getTaskStack(); if (stackController.pinnedStackResizeDisallowed()) { // TODO(stack-merge): Is this still relevant? if (stack.pinnedStackResizeDisallowed()) { return; } Loading Loading @@ -1893,8 +1893,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { if (currentStack != null) { // Task has already been restored once. Just re-parent it to the new stack. task.reparent(stack.mTaskStack, POSITION_TOP, true /*moveParents*/, "restoreRecentTaskLocked"); task.reparent(stack, POSITION_TOP, true /*moveParents*/, "restoreRecentTaskLocked"); return true; } Loading Loading @@ -2470,7 +2469,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { private void handleForcedResizableTaskIfNeeded(TaskRecord task, int reason) { final ActivityRecord topActivity = task.getTopActivity(); if (topActivity == null || topActivity.noDisplay || !topActivity.isNonResizableOrForcedResizable()) { || !topActivity.isNonResizableOrForcedResizable(task.getWindowingMode())) { return; } mService.getTaskChangeNotificationController().notifyActivityForcedResizable( Loading