Loading services/core/java/com/android/server/wm/ActivityRecord.java +4 −4 Original line number Diff line number Diff line Loading @@ -2504,7 +2504,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final DisplayContent display = stack.getDisplay(); next = display.topRunningActivity(); if (next != null) { display.positionStackAtTop(next.getRootTask(), display.mTaskContainers.positionStackAtTop(next.getRootTask(), false /* includingParents */, "finish-display-top"); } } Loading Loading @@ -2679,7 +2679,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final ActivityRecord next = display.topRunningActivity(); final boolean isLastStackOverEmptyHome = next == null && stack.isFocusedStackOnDisplay() && display.getOrCreateRootHomeTask() != null; && display.mTaskContainers.getOrCreateRootHomeTask() != null; if (isLastStackOverEmptyHome) { // Don't destroy activity immediately if this is the last activity on the display and // the display contains home stack. Although there is no next activity at the moment, Loading Loading @@ -4477,7 +4477,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // case where this is the top activity in a pinned stack. final boolean isTop = this == stack.getTopNonFinishingActivity(); final boolean isTopNotPinnedStack = stack.isAttached() && stack.getDisplay().isTopNotPinnedStack(stack); && stack.getDisplay().mTaskContainers.isTopNotPinnedStack(stack); final boolean visibleIgnoringDisplayStatus = stack.checkKeyguardVisibility(this, visibleIgnoringKeyguard, isTop && isTopNotPinnedStack); Loading Loading @@ -7389,7 +7389,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A */ boolean isResumedActivityOnDisplay() { final DisplayContent display = getDisplay(); return display != null && this == display.getResumedActivity(); return display != null && this == display.mTaskContainers.getResumedActivity(); } Loading services/core/java/com/android/server/wm/ActivityStack.java +22 −20 Original line number Diff line number Diff line Loading @@ -670,7 +670,7 @@ class ActivityStack extends Task { // Since always on top is only on when the stack is freeform or pinned, the state // can be toggled when the windowing mode changes. We must make sure the stack is // placed properly when always on top state changes. display.positionStackAtTop(this, false /* includingParents */); display.mTaskContainers.positionStackAtTop(this, false /* includingParents */); } } Loading Loading @@ -742,7 +742,7 @@ class ActivityStack extends Task { // Need to make sure windowing mode is supported. If we in the process of creating the stack // no need to resolve the windowing mode again as it is already resolved to the right mode. if (!creating) { windowingMode = display.validateWindowingMode(windowingMode, windowingMode = display.mTaskContainers.validateWindowingMode(windowingMode, null /* ActivityRecord */, topTask, getActivityType()); } if (display.getRootSplitScreenPrimaryTask() == this Loading @@ -752,7 +752,8 @@ class ActivityStack extends Task { windowingMode = mRestoreOverrideWindowingMode; } final boolean alreadyInSplitScreenMode = display.isSplitScreenModeActivated(); final boolean alreadyInSplitScreenMode = display.mTaskContainers .isSplitScreenModeActivated(); // Don't send non-resizeable notifications if the windowing mode changed was a side effect // of us entering split-screen mode. Loading @@ -769,7 +770,7 @@ class ActivityStack extends Task { // warning toast about it. mAtmService.getTaskChangeNotificationController() .notifyActivityDismissingDockedStack(); display.onSplitScreenModeDismissed(); display.mTaskContainers.onSplitScreenModeDismissed(); } } Loading Loading @@ -861,7 +862,7 @@ class ActivityStack extends Task { // TODO (b/78247419): Fix the rotation animation from fullscreen to minimized mode final boolean isRecentsComponentHome = mAtmService.getRecentTasks().isRecentsComponentHomeActivity(mCurrentUser); final ActivityStack recentStack = display.getOrCreateStack( final ActivityStack recentStack = display.mTaskContainers.getOrCreateStack( WINDOWING_MODE_SPLIT_SCREEN_SECONDARY, isRecentsComponentHome ? ACTIVITY_TYPE_HOME : ACTIVITY_TYPE_RECENTS, true /* onTop */); Loading Loading @@ -1058,7 +1059,7 @@ class ActivityStack extends Task { // cutting between them. // TODO(b/70677280): This is a workaround until we can fix as part of b/70677280. final ActivityStack topFullScreenStack = display.getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN); display.mTaskContainers.getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN); if (topFullScreenStack != null) { final ActivityStack primarySplitScreenStack = display.getRootSplitScreenPrimaryTask(); if (primarySplitScreenStack != null && display.getIndexOf(topFullScreenStack) Loading @@ -1071,11 +1072,11 @@ class ActivityStack extends Task { if (!isActivityTypeHome() && returnsToHomeStack()) { // Make sure the home stack is behind this stack since that is where we should return to // when this stack is no longer visible. display.moveHomeStackToFront(reason + " returnToHome"); display.mTaskContainers.moveHomeStackToFront(reason + " returnToHome"); } if (isRootTask()) { display.positionStackAtTop(this, false /* includingParents */, reason); display.mTaskContainers.positionStackAtTop(this, false /* includingParents */, reason); } if (task == null) { task = this; Loading @@ -1092,7 +1093,7 @@ class ActivityStack extends Task { return; } getDisplay().positionStackAtBottom(this, reason); getDisplay().mTaskContainers.positionStackAtBottom(this, reason); if (task != null && task != this) { positionChildAtBottom(task); } Loading Loading @@ -1460,7 +1461,7 @@ class ActivityStack extends Task { boolean isTopStackOnDisplay() { final DisplayContent display = getDisplay(); return display != null && display.isTopStack(this); return display != null && display.mTaskContainers.isTopStack(this); } /** Loading Loading @@ -1667,7 +1668,8 @@ class ActivityStack extends Task { */ boolean isTopSplitScreenStack() { return inSplitScreenWindowingMode() && this == getDisplay().getTopStackInWindowingMode(getWindowingMode()); && this == getDisplay().mTaskContainers .getTopStackInWindowingMode(getWindowingMode()); } /** @return True if the resizing of the primary-split-screen stack affects this stack size. */ Loading Loading @@ -1900,7 +1902,7 @@ class ActivityStack extends Task { // If the top activity is the resumed one, nothing to do. if (mResumedActivity == next && next.isState(RESUMED) && display.allResumedActivitiesComplete()) { && display.mTaskContainers.allResumedActivitiesComplete()) { // Make sure we have executed any pending transitions, since there // should be nothing left to do at this point. executeAppTransition(options); Loading Loading @@ -1979,7 +1981,7 @@ class ActivityStack extends Task { mStackSupervisor.setLaunchSource(next.info.applicationInfo.uid); ActivityRecord lastResumed = null; final ActivityStack lastFocusedStack = display.getLastFocusedStack(); final ActivityStack lastFocusedStack = display.mTaskContainers.getLastFocusedStack(); if (lastFocusedStack != null && lastFocusedStack != this) { // So, why aren't we using prev here??? See the param comment on the method. prev doesn't // represent the last resumed activity. However, the last focus stack does if it isn't null. Loading @@ -1993,7 +1995,7 @@ class ActivityStack extends Task { } } boolean pausing = display.pauseBackStacks(userLeaving, next); boolean pausing = display.mTaskContainers.pauseBackStacks(userLeaving, next); if (mResumedActivity != null) { if (DEBUG_STATES) Slog.d(TAG_STATES, "resumeTopActivityLocked: Pausing " + mResumedActivity); Loading Loading @@ -2022,7 +2024,7 @@ class ActivityStack extends Task { } return true; } else if (mResumedActivity == next && next.isState(RESUMED) && display.allResumedActivitiesComplete()) { && display.mTaskContainers.allResumedActivitiesComplete()) { // It is possible for the activity to be resumed when we paused back stacks above if the // next activity doesn't have to wait for pause to complete. // So, nothing else to-do except: Loading Loading @@ -2542,7 +2544,7 @@ class ActivityStack extends Task { if (stack.isActivityTypeHome() && (top == null || !top.mVisibleRequested)) { // If we will be focusing on the home stack next and its current top activity isn't // visible, then use the move the home stack task to top to make the activity visible. stack.getDisplay().moveHomeActivityToTop(reason); stack.getDisplay().mTaskContainers.moveHomeActivityToTop(reason); return stack; } Loading Loading @@ -3304,7 +3306,7 @@ class ActivityStack extends Task { final boolean wasResumed = topRunningActivity == task.getStack().mResumedActivity; boolean toTop = position >= getChildCount(); boolean includingParents = toTop || getDisplay().getNextFocusableStack(this, boolean includingParents = toTop || getDisplay().mTaskContainers.getNextFocusableStack(this, true /* ignoreCurrent */) == null; if (WindowManagerDebugConfig.DEBUG_STACK) { Slog.i(TAG_WM, "positionChildAt: positioning task=" + task + " at " + position); Loading Loading @@ -3348,7 +3350,7 @@ class ActivityStack extends Task { // always on top windows. Since the position the stack should be inserted into is calculated // properly in {@link DisplayContent#getTopInsertPosition()} in both cases, we can just // request that the stack is put at top here. display.positionStackAtTop(this, false /* includingParents */); display.mTaskContainers.positionStackAtTop(this, false /* includingParents */); } /** NOTE: Should only be called from {@link Task#reparent}. */ Loading Loading @@ -3399,7 +3401,7 @@ class ActivityStack extends Task { final Task task = getBottomMostTask(); setWindowingMode(WINDOWING_MODE_UNDEFINED); getDisplay().positionStackAtTop(this, false /* includingParents */); getDisplay().mTaskContainers.positionStackAtTop(this, false /* includingParents */); mStackSupervisor.scheduleUpdatePictureInPictureModeIfNeeded(task, this); MetricsLoggerWrapper.logPictureInPictureFullScreen(mAtmService.mContext, Loading Loading @@ -3519,7 +3521,7 @@ class ActivityStack extends Task { // If there are other focusable stacks on the display, the z-order of the display should not // be changed just because a task was placed at the bottom. E.g. if it is moving the topmost // task to bottom, the next focusable stack on the same display should be focused. final ActivityStack nextFocusableStack = getDisplay().getNextFocusableStack( final ActivityStack nextFocusableStack = getDisplay().mTaskContainers.getNextFocusableStack( child.getStack(), true /* ignoreCurrent */); positionChildAtBottom(child, nextFocusableStack == null /* includingParents */); child.updateTaskMovement(true); Loading services/core/java/com/android/server/wm/ActivityStackSupervisor.java +10 −9 Original line number Diff line number Diff line Loading @@ -414,14 +414,15 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { if (mToDisplay.getDisplayId() != stack.getDisplayId()) { mToDisplay.moveStackToDisplay(stack, mOnTop); } else if (mOnTop) { mToDisplay.positionStackAtTop(stack, false /* includingParents */); mToDisplay.mTaskContainers.positionStackAtTop(stack, false /* includingParents */); } else { mToDisplay.positionStackAtBottom(stack); mToDisplay.mTaskContainers.positionStackAtBottom(stack); } return; } final ActivityStack toStack = mToDisplay.getOrCreateStack( final ActivityStack toStack = mToDisplay.mTaskContainers.getOrCreateStack( null, mTmpOptions, task, task.getActivityType(), mOnTop); if (task == toStack) { // The task was reused as the root task. Loading Loading @@ -1458,7 +1459,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { || (focusedStack != null && focusedStack.isActivityTypeRecents())) { // We move home stack to front when we are on a fullscreen display and caller has // requested the home activity to move with it. Or the previous stack is recents. display.moveHomeStackToFront(reason); display.mTaskContainers.moveHomeStackToFront(reason); } } Loading Loading @@ -1877,7 +1878,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { mStoppingActivities.remove(r); final ActivityStack stack = r.getRootTask(); if (stack.getDisplay().allResumedActivitiesComplete()) { if (stack.getDisplay().mTaskContainers.allResumedActivitiesComplete()) { mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS); // Make sure activity & window visibility should be identical // for all displays in this stage. Loading Loading @@ -2241,7 +2242,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { final boolean isSecondaryDisplayPreferred = (preferredDisplayId != DEFAULT_DISPLAY && preferredDisplayId != INVALID_DISPLAY); final boolean inSplitScreenMode = actualStack != null && actualStack.getDisplay().isSplitScreenModeActivated(); && actualStack.getDisplay().mTaskContainers.isSplitScreenModeActivated(); if (((!inSplitScreenMode && preferredWindowingMode != WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) && !isSecondaryDisplayPreferred) || !task.isActivityTypeStandardOrUndefined()) { return; Loading Loading @@ -2289,12 +2290,12 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // Dismiss docked stack. If task appeared to be in docked stack but is not resizable - // we need to move it to top of fullscreen stack, otherwise it will be covered. final DisplayContent display = task.getStack().getDisplay(); if (display.isSplitScreenModeActivated()) { if (display.mTaskContainers.isSplitScreenModeActivated()) { // Display a warning toast that we tried to put an app that doesn't support // split-screen in split-screen. mService.getTaskChangeNotificationController() .notifyActivityDismissingDockedStack(); display.onSplitScreenModeDismissed(); display.mTaskContainers.onSplitScreenModeDismissed(); display.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS, true /* notifyClients */); } Loading Loading @@ -2612,7 +2613,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // from whatever is started from the recents activity, so move the home stack // forward. // TODO (b/115289124): Multi-display supports for recents. mRootWindowContainer.getDefaultDisplay().moveHomeStackToFront( mRootWindowContainer.getDefaultDisplay().mTaskContainers.moveHomeStackToFront( "startActivityFromRecents"); } Loading services/core/java/com/android/server/wm/ActivityStartController.java +2 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,8 @@ public class ActivityStartController { final ActivityStack homeStack; try { // Make sure home stack exist on display. homeStack = display.getOrCreateStack(WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_HOME, ON_TOP); homeStack = display.mTaskContainers.getOrCreateStack(WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_HOME, ON_TOP); } finally { mSupervisor.endDeferResume(); } Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +7 −6 Original line number Diff line number Diff line Loading @@ -2357,7 +2357,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } // Convert some windowing-mode changes into root-task reparents for split-screen. if (stack.inSplitScreenWindowingMode()) { stack.getDisplay().onSplitScreenModeDismissed(); stack.getDisplay().mTaskContainers.onSplitScreenModeDismissed(); } else { stack.setWindowingMode(windowingMode); Loading Loading @@ -2775,7 +2775,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } if (toTop) { display.positionStackAt(POSITION_TOP, primarySplitTask, false /* includingParents */); display.mTaskContainers.positionStackAt(POSITION_TOP, primarySplitTask, false /* includingParents */); } WindowContainerTransaction wct = new WindowContainerTransaction(); wct.reparent(task.getStack().mRemoteToken, primarySplitTask.mRemoteToken, toTop); Loading Loading @@ -3244,8 +3245,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } final ActivityStack stack = r.getRootTask(); final Task task = stack.getDisplay().createStack(stack.getWindowingMode(), stack.getActivityType(), !ON_TOP, ainfo, intent, final Task task = stack.getDisplay().mTaskContainers.createStack( stack.getWindowingMode(), stack.getActivityType(), !ON_TOP, ainfo, intent, false /* createdByOrganizer */); if (!mRecentTasks.addToBottom(task)) { Loading Loading @@ -3308,10 +3309,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { throw new IllegalArgumentException("resizeTask not allowed on task=" + task); } if (bounds == null && stack.getWindowingMode() == WINDOWING_MODE_FREEFORM) { stack = stack.getDisplay().getOrCreateStack( stack = stack.getDisplay().mTaskContainers.getOrCreateStack( WINDOWING_MODE_FULLSCREEN, stack.getActivityType(), ON_TOP); } else if (bounds != null && stack.getWindowingMode() != WINDOWING_MODE_FREEFORM) { stack = stack.getDisplay().getOrCreateStack( stack = stack.getDisplay().mTaskContainers.getOrCreateStack( WINDOWING_MODE_FREEFORM, stack.getActivityType(), ON_TOP); } Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +4 −4 Original line number Diff line number Diff line Loading @@ -2504,7 +2504,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final DisplayContent display = stack.getDisplay(); next = display.topRunningActivity(); if (next != null) { display.positionStackAtTop(next.getRootTask(), display.mTaskContainers.positionStackAtTop(next.getRootTask(), false /* includingParents */, "finish-display-top"); } } Loading Loading @@ -2679,7 +2679,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final ActivityRecord next = display.topRunningActivity(); final boolean isLastStackOverEmptyHome = next == null && stack.isFocusedStackOnDisplay() && display.getOrCreateRootHomeTask() != null; && display.mTaskContainers.getOrCreateRootHomeTask() != null; if (isLastStackOverEmptyHome) { // Don't destroy activity immediately if this is the last activity on the display and // the display contains home stack. Although there is no next activity at the moment, Loading Loading @@ -4477,7 +4477,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // case where this is the top activity in a pinned stack. final boolean isTop = this == stack.getTopNonFinishingActivity(); final boolean isTopNotPinnedStack = stack.isAttached() && stack.getDisplay().isTopNotPinnedStack(stack); && stack.getDisplay().mTaskContainers.isTopNotPinnedStack(stack); final boolean visibleIgnoringDisplayStatus = stack.checkKeyguardVisibility(this, visibleIgnoringKeyguard, isTop && isTopNotPinnedStack); Loading Loading @@ -7389,7 +7389,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A */ boolean isResumedActivityOnDisplay() { final DisplayContent display = getDisplay(); return display != null && this == display.getResumedActivity(); return display != null && this == display.mTaskContainers.getResumedActivity(); } Loading
services/core/java/com/android/server/wm/ActivityStack.java +22 −20 Original line number Diff line number Diff line Loading @@ -670,7 +670,7 @@ class ActivityStack extends Task { // Since always on top is only on when the stack is freeform or pinned, the state // can be toggled when the windowing mode changes. We must make sure the stack is // placed properly when always on top state changes. display.positionStackAtTop(this, false /* includingParents */); display.mTaskContainers.positionStackAtTop(this, false /* includingParents */); } } Loading Loading @@ -742,7 +742,7 @@ class ActivityStack extends Task { // Need to make sure windowing mode is supported. If we in the process of creating the stack // no need to resolve the windowing mode again as it is already resolved to the right mode. if (!creating) { windowingMode = display.validateWindowingMode(windowingMode, windowingMode = display.mTaskContainers.validateWindowingMode(windowingMode, null /* ActivityRecord */, topTask, getActivityType()); } if (display.getRootSplitScreenPrimaryTask() == this Loading @@ -752,7 +752,8 @@ class ActivityStack extends Task { windowingMode = mRestoreOverrideWindowingMode; } final boolean alreadyInSplitScreenMode = display.isSplitScreenModeActivated(); final boolean alreadyInSplitScreenMode = display.mTaskContainers .isSplitScreenModeActivated(); // Don't send non-resizeable notifications if the windowing mode changed was a side effect // of us entering split-screen mode. Loading @@ -769,7 +770,7 @@ class ActivityStack extends Task { // warning toast about it. mAtmService.getTaskChangeNotificationController() .notifyActivityDismissingDockedStack(); display.onSplitScreenModeDismissed(); display.mTaskContainers.onSplitScreenModeDismissed(); } } Loading Loading @@ -861,7 +862,7 @@ class ActivityStack extends Task { // TODO (b/78247419): Fix the rotation animation from fullscreen to minimized mode final boolean isRecentsComponentHome = mAtmService.getRecentTasks().isRecentsComponentHomeActivity(mCurrentUser); final ActivityStack recentStack = display.getOrCreateStack( final ActivityStack recentStack = display.mTaskContainers.getOrCreateStack( WINDOWING_MODE_SPLIT_SCREEN_SECONDARY, isRecentsComponentHome ? ACTIVITY_TYPE_HOME : ACTIVITY_TYPE_RECENTS, true /* onTop */); Loading Loading @@ -1058,7 +1059,7 @@ class ActivityStack extends Task { // cutting between them. // TODO(b/70677280): This is a workaround until we can fix as part of b/70677280. final ActivityStack topFullScreenStack = display.getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN); display.mTaskContainers.getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN); if (topFullScreenStack != null) { final ActivityStack primarySplitScreenStack = display.getRootSplitScreenPrimaryTask(); if (primarySplitScreenStack != null && display.getIndexOf(topFullScreenStack) Loading @@ -1071,11 +1072,11 @@ class ActivityStack extends Task { if (!isActivityTypeHome() && returnsToHomeStack()) { // Make sure the home stack is behind this stack since that is where we should return to // when this stack is no longer visible. display.moveHomeStackToFront(reason + " returnToHome"); display.mTaskContainers.moveHomeStackToFront(reason + " returnToHome"); } if (isRootTask()) { display.positionStackAtTop(this, false /* includingParents */, reason); display.mTaskContainers.positionStackAtTop(this, false /* includingParents */, reason); } if (task == null) { task = this; Loading @@ -1092,7 +1093,7 @@ class ActivityStack extends Task { return; } getDisplay().positionStackAtBottom(this, reason); getDisplay().mTaskContainers.positionStackAtBottom(this, reason); if (task != null && task != this) { positionChildAtBottom(task); } Loading Loading @@ -1460,7 +1461,7 @@ class ActivityStack extends Task { boolean isTopStackOnDisplay() { final DisplayContent display = getDisplay(); return display != null && display.isTopStack(this); return display != null && display.mTaskContainers.isTopStack(this); } /** Loading Loading @@ -1667,7 +1668,8 @@ class ActivityStack extends Task { */ boolean isTopSplitScreenStack() { return inSplitScreenWindowingMode() && this == getDisplay().getTopStackInWindowingMode(getWindowingMode()); && this == getDisplay().mTaskContainers .getTopStackInWindowingMode(getWindowingMode()); } /** @return True if the resizing of the primary-split-screen stack affects this stack size. */ Loading Loading @@ -1900,7 +1902,7 @@ class ActivityStack extends Task { // If the top activity is the resumed one, nothing to do. if (mResumedActivity == next && next.isState(RESUMED) && display.allResumedActivitiesComplete()) { && display.mTaskContainers.allResumedActivitiesComplete()) { // Make sure we have executed any pending transitions, since there // should be nothing left to do at this point. executeAppTransition(options); Loading Loading @@ -1979,7 +1981,7 @@ class ActivityStack extends Task { mStackSupervisor.setLaunchSource(next.info.applicationInfo.uid); ActivityRecord lastResumed = null; final ActivityStack lastFocusedStack = display.getLastFocusedStack(); final ActivityStack lastFocusedStack = display.mTaskContainers.getLastFocusedStack(); if (lastFocusedStack != null && lastFocusedStack != this) { // So, why aren't we using prev here??? See the param comment on the method. prev doesn't // represent the last resumed activity. However, the last focus stack does if it isn't null. Loading @@ -1993,7 +1995,7 @@ class ActivityStack extends Task { } } boolean pausing = display.pauseBackStacks(userLeaving, next); boolean pausing = display.mTaskContainers.pauseBackStacks(userLeaving, next); if (mResumedActivity != null) { if (DEBUG_STATES) Slog.d(TAG_STATES, "resumeTopActivityLocked: Pausing " + mResumedActivity); Loading Loading @@ -2022,7 +2024,7 @@ class ActivityStack extends Task { } return true; } else if (mResumedActivity == next && next.isState(RESUMED) && display.allResumedActivitiesComplete()) { && display.mTaskContainers.allResumedActivitiesComplete()) { // It is possible for the activity to be resumed when we paused back stacks above if the // next activity doesn't have to wait for pause to complete. // So, nothing else to-do except: Loading Loading @@ -2542,7 +2544,7 @@ class ActivityStack extends Task { if (stack.isActivityTypeHome() && (top == null || !top.mVisibleRequested)) { // If we will be focusing on the home stack next and its current top activity isn't // visible, then use the move the home stack task to top to make the activity visible. stack.getDisplay().moveHomeActivityToTop(reason); stack.getDisplay().mTaskContainers.moveHomeActivityToTop(reason); return stack; } Loading Loading @@ -3304,7 +3306,7 @@ class ActivityStack extends Task { final boolean wasResumed = topRunningActivity == task.getStack().mResumedActivity; boolean toTop = position >= getChildCount(); boolean includingParents = toTop || getDisplay().getNextFocusableStack(this, boolean includingParents = toTop || getDisplay().mTaskContainers.getNextFocusableStack(this, true /* ignoreCurrent */) == null; if (WindowManagerDebugConfig.DEBUG_STACK) { Slog.i(TAG_WM, "positionChildAt: positioning task=" + task + " at " + position); Loading Loading @@ -3348,7 +3350,7 @@ class ActivityStack extends Task { // always on top windows. Since the position the stack should be inserted into is calculated // properly in {@link DisplayContent#getTopInsertPosition()} in both cases, we can just // request that the stack is put at top here. display.positionStackAtTop(this, false /* includingParents */); display.mTaskContainers.positionStackAtTop(this, false /* includingParents */); } /** NOTE: Should only be called from {@link Task#reparent}. */ Loading Loading @@ -3399,7 +3401,7 @@ class ActivityStack extends Task { final Task task = getBottomMostTask(); setWindowingMode(WINDOWING_MODE_UNDEFINED); getDisplay().positionStackAtTop(this, false /* includingParents */); getDisplay().mTaskContainers.positionStackAtTop(this, false /* includingParents */); mStackSupervisor.scheduleUpdatePictureInPictureModeIfNeeded(task, this); MetricsLoggerWrapper.logPictureInPictureFullScreen(mAtmService.mContext, Loading Loading @@ -3519,7 +3521,7 @@ class ActivityStack extends Task { // If there are other focusable stacks on the display, the z-order of the display should not // be changed just because a task was placed at the bottom. E.g. if it is moving the topmost // task to bottom, the next focusable stack on the same display should be focused. final ActivityStack nextFocusableStack = getDisplay().getNextFocusableStack( final ActivityStack nextFocusableStack = getDisplay().mTaskContainers.getNextFocusableStack( child.getStack(), true /* ignoreCurrent */); positionChildAtBottom(child, nextFocusableStack == null /* includingParents */); child.updateTaskMovement(true); Loading
services/core/java/com/android/server/wm/ActivityStackSupervisor.java +10 −9 Original line number Diff line number Diff line Loading @@ -414,14 +414,15 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { if (mToDisplay.getDisplayId() != stack.getDisplayId()) { mToDisplay.moveStackToDisplay(stack, mOnTop); } else if (mOnTop) { mToDisplay.positionStackAtTop(stack, false /* includingParents */); mToDisplay.mTaskContainers.positionStackAtTop(stack, false /* includingParents */); } else { mToDisplay.positionStackAtBottom(stack); mToDisplay.mTaskContainers.positionStackAtBottom(stack); } return; } final ActivityStack toStack = mToDisplay.getOrCreateStack( final ActivityStack toStack = mToDisplay.mTaskContainers.getOrCreateStack( null, mTmpOptions, task, task.getActivityType(), mOnTop); if (task == toStack) { // The task was reused as the root task. Loading Loading @@ -1458,7 +1459,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { || (focusedStack != null && focusedStack.isActivityTypeRecents())) { // We move home stack to front when we are on a fullscreen display and caller has // requested the home activity to move with it. Or the previous stack is recents. display.moveHomeStackToFront(reason); display.mTaskContainers.moveHomeStackToFront(reason); } } Loading Loading @@ -1877,7 +1878,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { mStoppingActivities.remove(r); final ActivityStack stack = r.getRootTask(); if (stack.getDisplay().allResumedActivitiesComplete()) { if (stack.getDisplay().mTaskContainers.allResumedActivitiesComplete()) { mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS); // Make sure activity & window visibility should be identical // for all displays in this stage. Loading Loading @@ -2241,7 +2242,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { final boolean isSecondaryDisplayPreferred = (preferredDisplayId != DEFAULT_DISPLAY && preferredDisplayId != INVALID_DISPLAY); final boolean inSplitScreenMode = actualStack != null && actualStack.getDisplay().isSplitScreenModeActivated(); && actualStack.getDisplay().mTaskContainers.isSplitScreenModeActivated(); if (((!inSplitScreenMode && preferredWindowingMode != WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) && !isSecondaryDisplayPreferred) || !task.isActivityTypeStandardOrUndefined()) { return; Loading Loading @@ -2289,12 +2290,12 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // Dismiss docked stack. If task appeared to be in docked stack but is not resizable - // we need to move it to top of fullscreen stack, otherwise it will be covered. final DisplayContent display = task.getStack().getDisplay(); if (display.isSplitScreenModeActivated()) { if (display.mTaskContainers.isSplitScreenModeActivated()) { // Display a warning toast that we tried to put an app that doesn't support // split-screen in split-screen. mService.getTaskChangeNotificationController() .notifyActivityDismissingDockedStack(); display.onSplitScreenModeDismissed(); display.mTaskContainers.onSplitScreenModeDismissed(); display.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS, true /* notifyClients */); } Loading Loading @@ -2612,7 +2613,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { // from whatever is started from the recents activity, so move the home stack // forward. // TODO (b/115289124): Multi-display supports for recents. mRootWindowContainer.getDefaultDisplay().moveHomeStackToFront( mRootWindowContainer.getDefaultDisplay().mTaskContainers.moveHomeStackToFront( "startActivityFromRecents"); } Loading
services/core/java/com/android/server/wm/ActivityStartController.java +2 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,8 @@ public class ActivityStartController { final ActivityStack homeStack; try { // Make sure home stack exist on display. homeStack = display.getOrCreateStack(WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_HOME, ON_TOP); homeStack = display.mTaskContainers.getOrCreateStack(WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_HOME, ON_TOP); } finally { mSupervisor.endDeferResume(); } Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +7 −6 Original line number Diff line number Diff line Loading @@ -2357,7 +2357,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } // Convert some windowing-mode changes into root-task reparents for split-screen. if (stack.inSplitScreenWindowingMode()) { stack.getDisplay().onSplitScreenModeDismissed(); stack.getDisplay().mTaskContainers.onSplitScreenModeDismissed(); } else { stack.setWindowingMode(windowingMode); Loading Loading @@ -2775,7 +2775,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } if (toTop) { display.positionStackAt(POSITION_TOP, primarySplitTask, false /* includingParents */); display.mTaskContainers.positionStackAt(POSITION_TOP, primarySplitTask, false /* includingParents */); } WindowContainerTransaction wct = new WindowContainerTransaction(); wct.reparent(task.getStack().mRemoteToken, primarySplitTask.mRemoteToken, toTop); Loading Loading @@ -3244,8 +3245,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } final ActivityStack stack = r.getRootTask(); final Task task = stack.getDisplay().createStack(stack.getWindowingMode(), stack.getActivityType(), !ON_TOP, ainfo, intent, final Task task = stack.getDisplay().mTaskContainers.createStack( stack.getWindowingMode(), stack.getActivityType(), !ON_TOP, ainfo, intent, false /* createdByOrganizer */); if (!mRecentTasks.addToBottom(task)) { Loading Loading @@ -3308,10 +3309,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { throw new IllegalArgumentException("resizeTask not allowed on task=" + task); } if (bounds == null && stack.getWindowingMode() == WINDOWING_MODE_FREEFORM) { stack = stack.getDisplay().getOrCreateStack( stack = stack.getDisplay().mTaskContainers.getOrCreateStack( WINDOWING_MODE_FULLSCREEN, stack.getActivityType(), ON_TOP); } else if (bounds != null && stack.getWindowingMode() != WINDOWING_MODE_FREEFORM) { stack = stack.getDisplay().getOrCreateStack( stack = stack.getDisplay().mTaskContainers.getOrCreateStack( WINDOWING_MODE_FREEFORM, stack.getActivityType(), ON_TOP); } Loading