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

Commit dc077271 authored by Louis Chang's avatar Louis Chang
Browse files

Merge TaskStack and ActivityStack into one class (68/n)

Merge TaskStack and ActivityStack into one class.

Bug: 80414790
Test: Existing tests pass
Change-Id: I96fd5137cb868f277581b6c6d719d63fe2a8c677
parent 3d2b00f3
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1160,7 +1160,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        this.task = task;
    }

    TaskStack getStack() {
    ActivityStack getStack() {
        return task != null ? task.getTaskStack() : null;
    }

@@ -1202,7 +1202,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        } else if (mLastParent != null && mLastParent.getTaskStack() != null) {
            task.getTaskStack().mExitingActivities.remove(this);
        }
        final TaskStack stack = getStack();
        final ActivityStack stack = getStack();

        // If we reparent, make sure to remove ourselves from the old animation registry.
        if (mAnimatingActivityRegistry != null) {
@@ -1266,7 +1266,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

        if (prevDc.mFocusedApp == this) {
            prevDc.setFocusedApp(null);
            final TaskStack stack = dc.getTopStack();
            final ActivityStack stack = dc.getTopStack();
            if (stack != null) {
                final Task task = stack.getTopChild();
                if (task != null && task.getTopChild() == this) {
@@ -3024,7 +3024,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            getDisplayContent().mNoAnimationNotifyOnTransitionFinished.add(token);
        }

        final TaskStack stack = getStack();
        final ActivityStack stack = getStack();
        if (delayed && !isEmpty()) {
            // set the token aside because it has an active animation to be finished
            ProtoLog.v(WM_DEBUG_ADD_REMOVE,
@@ -3754,7 +3754,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

                // Notify the pinned stack upon all windows drawn. If there was an animation in
                // progress then this signal will resume that animation.
                final TaskStack pinnedStack = mDisplayContent.getPinnedStack();
                final ActivityStack pinnedStack = mDisplayContent.getPinnedStack();
                if (pinnedStack != null) {
                    pinnedStack.onAllWindowsDrawn();
                }
@@ -5787,7 +5787,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                    getTransit(), task)) {
                task.getBounds(mTmpRect);
            } else {
                final TaskStack stack = getStack();
                final ActivityStack stack = getStack();
                if (stack == null) {
                    return;
                }
@@ -6547,7 +6547,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    void savePinnedStackBounds() {
        // 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)
        final TaskStack pinnedStack = mDisplayContent.getPinnedStack();
        final ActivityStack pinnedStack = mDisplayContent.getPinnedStack();
        if (pinnedStack == null) return;
        final Rect stackBounds;
        if (pinnedStack.lastAnimatingBoundsWasToFullscreen()) {
+1843 −121

File changed.

Preview size limit exceeded, changes collapsed.

+0 −9
Original line number Diff line number Diff line
@@ -1708,15 +1708,6 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
            return;
        }

        // It is possible for the bounds animation from the WM to call this but be delayed by
        // 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.
        // TODO(stack-merge): Is this still relevant?
        if (stack.pinnedStackResizeDisallowed()) {
            return;
        }

        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "resizePinnedStack");
        mService.deferWindowLayout();
        try {
+56 −57

File changed.

Preview size limit exceeded, changes collapsed.

+16 −15

File changed.

Preview size limit exceeded, changes collapsed.

Loading