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

Commit 734b896c authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Renamed some getXXXStack methods to getRootXXXTask (87/n)

Also stacks are tasks now so this is "techincally" correct.
Also, stacks are going to be removed soon, so this CL helps reduce
size of future CLs.

Bug: 80414790
Test: Existing tests pass.
Change-Id: Ibc47b63f19fd154b9162264f0ad1c9259a3e5d56
parent 1ebcd8e4
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -2223,7 +2223,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        boolean isCurrentAppLocked =
        boolean isCurrentAppLocked =
                mAtmService.getLockTaskModeState() != LOCK_TASK_MODE_NONE;
                mAtmService.getLockTaskModeState() != LOCK_TASK_MODE_NONE;
        final DisplayContent display = getDisplay();
        final DisplayContent display = getDisplay();
        boolean hasPinnedStack = display != null && display.hasPinnedStack();
        boolean hasPinnedStack = display != null && display.hasPinnedTask();
        // Don't return early if !isNotLocked, since we want to throw an exception if the activity
        // Don't return early if !isNotLocked, since we want to throw an exception if the activity
        // is in an incorrect state
        // is in an incorrect state
        boolean isNotLockedOrOnKeyguard = !isKeyguardLocked && !isCurrentAppLocked;
        boolean isNotLockedOrOnKeyguard = !isKeyguardLocked && !isCurrentAppLocked;
@@ -2669,7 +2669,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // DisplayContent#topRunningActivity().
        // DisplayContent#topRunningActivity().
        final ActivityRecord next = display.topRunningActivity();
        final ActivityRecord next = display.topRunningActivity();
        final boolean isLastStackOverEmptyHome =
        final boolean isLastStackOverEmptyHome =
                next == null && stack.isFocusedStackOnDisplay() && display.getHomeStack() != null;
                next == null && stack.isFocusedStackOnDisplay() && display.getRootHomeTask() != null;
        if (isLastStackOverEmptyHome) {
        if (isLastStackOverEmptyHome) {
            // Don't destroy activity immediately if this is the last activity on the display and
            // 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,
            // the display contains home stack. Although there is no next activity at the moment,
@@ -3824,7 +3824,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A


                // Notify the pinned stack upon all windows drawn. If there was an animation in
                // Notify the pinned stack upon all windows drawn. If there was an animation in
                // progress then this signal will resume that animation.
                // progress then this signal will resume that animation.
                final ActivityStack pinnedStack = mDisplayContent.getPinnedStack();
                final ActivityStack pinnedStack = mDisplayContent.getRootPinnedTask();
                if (pinnedStack != null) {
                if (pinnedStack != null) {
                    pinnedStack.onAllWindowsDrawn();
                    pinnedStack.onAllWindowsDrawn();
                }
                }
@@ -6712,7 +6712,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    void savePinnedStackBounds() {
    void savePinnedStackBounds() {
        // Leaving PiP to fullscreen, save the snap fraction based on the pre-animation bounds
        // Leaving PiP to fullscreen, save the snap fraction based on the pre-animation bounds
        // for the next re-entry into PiP (assuming the activity is not hidden or destroyed)
        // for the next re-entry into PiP (assuming the activity is not hidden or destroyed)
        final ActivityStack pinnedStack = mDisplayContent.getPinnedStack();
        final ActivityStack pinnedStack = mDisplayContent.getRootPinnedTask();
        if (pinnedStack == null) return;
        if (pinnedStack == null) return;
        final Rect stackBounds;
        final Rect stackBounds;
        if (pinnedStack.lastAnimatingBoundsWasToFullscreen()) {
        if (pinnedStack.lastAnimatingBoundsWasToFullscreen()) {
+8 −8
Original line number Original line Diff line number Diff line
@@ -728,11 +728,11 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
                setBounds(newBounds);
                setBounds(newBounds);
                newBounds.set(newBounds);
                newBounds.set(newBounds);
            } else if (overrideWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) {
            } else if (overrideWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) {
                Rect dockedBounds = display.getSplitScreenPrimaryStack().getBounds();
                Rect dockedBounds = display.getRootSplitScreenPrimaryTask().getBounds();
                final boolean isMinimizedDock =
                final boolean isMinimizedDock =
                        display.mDisplayContent.getDockedDividerController().isMinimizedDock();
                        display.mDisplayContent.getDockedDividerController().isMinimizedDock();
                if (isMinimizedDock) {
                if (isMinimizedDock) {
                    Task topTask = display.getSplitScreenPrimaryStack().getTopMostTask();
                    Task topTask = display.getRootSplitScreenPrimaryTask().getTopMostTask();
                    if (topTask != null) {
                    if (topTask != null) {
                        dockedBounds = topTask.getBounds();
                        dockedBounds = topTask.getBounds();
                    }
                    }
@@ -826,7 +826,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
        final int currentOverrideMode = getRequestedOverrideWindowingMode();
        final int currentOverrideMode = getRequestedOverrideWindowingMode();
        final DisplayContent display = getDisplay();
        final DisplayContent display = getDisplay();
        final Task topTask = getTopMostTask();
        final Task topTask = getTopMostTask();
        final ActivityStack splitScreenStack = display.getSplitScreenPrimaryStack();
        final ActivityStack splitScreenStack = display.getRootSplitScreenPrimaryTask();
        int windowingMode = preferredWindowingMode;
        int windowingMode = preferredWindowingMode;
        if (preferredWindowingMode == WINDOWING_MODE_UNDEFINED
        if (preferredWindowingMode == WINDOWING_MODE_UNDEFINED
                && isTransientWindowingMode(currentMode)) {
                && isTransientWindowingMode(currentMode)) {
@@ -847,7 +847,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
            windowingMode = mRestoreOverrideWindowingMode;
            windowingMode = mRestoreOverrideWindowingMode;
        }
        }


        final boolean alreadyInSplitScreenMode = display.hasSplitScreenPrimaryStack();
        final boolean alreadyInSplitScreenMode = display.hasSplitScreenPrimaryTask();


        // Don't send non-resizeable notifications if the windowing mode changed was a side effect
        // Don't send non-resizeable notifications if the windowing mode changed was a side effect
        // of us entering split-screen mode.
        // of us entering split-screen mode.
@@ -864,7 +864,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
                // warning toast about it.
                // warning toast about it.
                mAtmService.getTaskChangeNotificationController()
                mAtmService.getTaskChangeNotificationController()
                        .notifyActivityDismissingDockedStack();
                        .notifyActivityDismissingDockedStack();
                final ActivityStack primarySplitStack = display.getSplitScreenPrimaryStack();
                final ActivityStack primarySplitStack = display.getRootSplitScreenPrimaryTask();
                primarySplitStack.setWindowingModeInSurfaceTransaction(WINDOWING_MODE_UNDEFINED,
                primarySplitStack.setWindowingModeInSurfaceTransaction(WINDOWING_MODE_UNDEFINED,
                        false /* animate */, false /* showRecents */,
                        false /* animate */, false /* showRecents */,
                        false /* enteringSplitScreenMode */, true /* deferEnsuringVisibility */,
                        false /* enteringSplitScreenMode */, true /* deferEnsuringVisibility */,
@@ -1161,7 +1161,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
            final ActivityStack topFullScreenStack =
            final ActivityStack topFullScreenStack =
                    display.getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN);
                    display.getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN);
            if (topFullScreenStack != null) {
            if (topFullScreenStack != null) {
                final ActivityStack primarySplitScreenStack = display.getSplitScreenPrimaryStack();
                final ActivityStack primarySplitScreenStack = display.getRootSplitScreenPrimaryTask();
                if (display.getIndexOf(topFullScreenStack)
                if (display.getIndexOf(topFullScreenStack)
                        > display.getIndexOf(primarySplitScreenStack)) {
                        > display.getIndexOf(primarySplitScreenStack)) {
                    primarySplitScreenStack.moveToFront(reason + " splitScreenToTop");
                    primarySplitScreenStack.moveToFront(reason + " splitScreenToTop");
@@ -1559,7 +1559,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
        // focus). Also if there is an active pinned stack - we always want to notify it about
        // focus). Also if there is an active pinned stack - we always want to notify it about
        // task stack changes, because its positioning may depend on it.
        // task stack changes, because its positioning may depend on it.
        if (mStackSupervisor.mAppVisibilitiesChangedSinceLastPause
        if (mStackSupervisor.mAppVisibilitiesChangedSinceLastPause
                || (getDisplay() != null && getDisplay().hasPinnedStack())) {
                || (getDisplay() != null && getDisplay().hasPinnedTask())) {
            mAtmService.getTaskChangeNotificationController().notifyTaskStackChanged();
            mAtmService.getTaskChangeNotificationController().notifyTaskStackChanged();
            mStackSupervisor.mAppVisibilitiesChangedSinceLastPause = false;
            mStackSupervisor.mAppVisibilitiesChangedSinceLastPause = false;
        }
        }
@@ -4719,7 +4719,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
            // activity early for the recents animation prior to the PiP animation starting, there
            // activity early for the recents animation prior to the PiP animation starting, there
            // is no subsequent all-drawn signal. In this case, we can skip the pause when the home
            // is no subsequent all-drawn signal. In this case, we can skip the pause when the home
            // stack is already visible and drawn.
            // stack is already visible and drawn.
            final ActivityStack homeStack = mDisplayContent.getHomeStack();
            final ActivityStack homeStack = mDisplayContent.getRootHomeTask();
            if (homeStack == null) {
            if (homeStack == null) {
                return true;
                return true;
            }
            }
+4 −4
Original line number Original line Diff line number Diff line
@@ -1582,7 +1582,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        }
        }


        final ActivityStack stack =
        final ActivityStack stack =
                mRootWindowContainer.getDefaultDisplay().getSplitScreenPrimaryStack();
                mRootWindowContainer.getDefaultDisplay().getRootSplitScreenPrimaryTask();
        if (stack == null) {
        if (stack == null) {
            Slog.w(TAG, "resizeDockedStackLocked: docked stack not found");
            Slog.w(TAG, "resizeDockedStackLocked: docked stack not found");
            return;
            return;
@@ -1670,7 +1670,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
    void resizePinnedStackLocked(Rect pinnedBounds, Rect tempPinnedTaskBounds) {
    void resizePinnedStackLocked(Rect pinnedBounds, Rect tempPinnedTaskBounds) {
        // TODO(multi-display): The display containing the stack should be passed in.
        // TODO(multi-display): The display containing the stack should be passed in.
        final ActivityStack stack =
        final ActivityStack stack =
                mRootWindowContainer.getDefaultDisplay().getPinnedStack();
                mRootWindowContainer.getDefaultDisplay().getRootPinnedTask();
        if (stack == null) {
        if (stack == null) {
            Slog.w(TAG, "resizePinnedStackLocked: pinned stack not found");
            Slog.w(TAG, "resizePinnedStackLocked: pinned stack not found");
            return;
            return;
@@ -2395,7 +2395,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        final boolean isSecondaryDisplayPreferred =
        final boolean isSecondaryDisplayPreferred =
                (preferredDisplayId != DEFAULT_DISPLAY && preferredDisplayId != INVALID_DISPLAY);
                (preferredDisplayId != DEFAULT_DISPLAY && preferredDisplayId != INVALID_DISPLAY);
        final boolean inSplitScreenMode = actualStack != null
        final boolean inSplitScreenMode = actualStack != null
                && actualStack.getDisplay().hasSplitScreenPrimaryStack();
                && actualStack.getDisplay().hasSplitScreenPrimaryTask();
        if (((!inSplitScreenMode && preferredWindowingMode != WINDOWING_MODE_SPLIT_SCREEN_PRIMARY)
        if (((!inSplitScreenMode && preferredWindowingMode != WINDOWING_MODE_SPLIT_SCREEN_PRIMARY)
                && !isSecondaryDisplayPreferred) || !task.isActivityTypeStandardOrUndefined()) {
                && !isSecondaryDisplayPreferred) || !task.isActivityTypeStandardOrUndefined()) {
            return;
            return;
@@ -2444,7 +2444,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
            // we need to move it to top of fullscreen stack, otherwise it will be covered.
            // we need to move it to top of fullscreen stack, otherwise it will be covered.


            final ActivityStack dockedStack =
            final ActivityStack dockedStack =
                    task.getStack().getDisplay().getSplitScreenPrimaryStack();
                    task.getStack().getDisplay().getRootSplitScreenPrimaryTask();
            if (dockedStack != null) {
            if (dockedStack != null) {
                // Display a warning toast that we tried to put an app that doesn't support
                // Display a warning toast that we tried to put an app that doesn't support
                // split-screen in split-screen.
                // split-screen in split-screen.
+1 −1
Original line number Original line Diff line number Diff line
@@ -1365,7 +1365,7 @@ class ActivityStarter {
                    break;
                    break;
                case WINDOWING_MODE_SPLIT_SCREEN_PRIMARY:
                case WINDOWING_MODE_SPLIT_SCREEN_PRIMARY:
                    final ActivityStack homeStack =
                    final ActivityStack homeStack =
                            startedActivityStack.getDisplay().getHomeStack();
                            startedActivityStack.getDisplay().getRootHomeTask();
                    if (homeStack != null && homeStack.shouldBeVisible(null /* starting */)) {
                    if (homeStack != null && homeStack.shouldBeVisible(null /* starting */)) {
                        mService.mWindowManager.showRecentApps();
                        mService.mWindowManager.showRecentApps();
                    }
                    }
+2 −2
Original line number Original line Diff line number Diff line
@@ -4080,7 +4080,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        try {
        try {
            synchronized (mGlobalLock) {
            synchronized (mGlobalLock) {
                final ActivityStack stack =
                final ActivityStack stack =
                        mRootWindowContainer.getDefaultDisplay().getSplitScreenPrimaryStack();
                        mRootWindowContainer.getDefaultDisplay().getRootSplitScreenPrimaryTask();
                if (stack == null) {
                if (stack == null) {
                    Slog.w(TAG, "dismissSplitScreenMode: primary split-screen stack not found.");
                    Slog.w(TAG, "dismissSplitScreenMode: primary split-screen stack not found.");
                    return;
                    return;
@@ -4121,7 +4121,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        try {
        try {
            synchronized (mGlobalLock) {
            synchronized (mGlobalLock) {
                final ActivityStack stack =
                final ActivityStack stack =
                        mRootWindowContainer.getDefaultDisplay().getPinnedStack();
                        mRootWindowContainer.getDefaultDisplay().getRootPinnedTask();
                if (stack == null) {
                if (stack == null) {
                    Slog.w(TAG, "dismissPip: pinned stack not found.");
                    Slog.w(TAG, "dismissPip: pinned stack not found.");
                    return;
                    return;
Loading