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

Commit e29879cb authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Only set ready early in AR.finish if it is a self-contained op" into udc-dev

parents fa337258 214d744a
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -3522,6 +3522,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

            final boolean endTask = task.getTopNonFinishingActivity() == null
                    && !task.isClearingToReuseTask();
            final Transition newTransition =
                    mTransitionController.requestCloseTransitionIfNeeded(endTask ? task : this);
            if (isState(RESUMED)) {
                if (endTask) {
@@ -3576,8 +3577,17 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            } else if (!isState(PAUSING)) {
                if (mVisibleRequested) {
                    // Prepare and execute close transition.
                    if (mTransitionController.isShellTransitionsEnabled()) {
                        setVisibility(false);
                        if (newTransition != null) {
                            // This is a transition specifically for this close operation, so set
                            // ready now.
                            newTransition.setReady(mDisplayContent, true);
                        }
                    } else {
                        prepareActivityHideTransitionAnimation();
                    }
                }

                final boolean removedActivity = completeFinishing("finishIfPossible") == null;
                // Performance optimization - only invoke OOM adjustment if the state changed to
+9 −4
Original line number Diff line number Diff line
@@ -577,12 +577,16 @@ class TransitionController {
        return transition;
    }

    /** Requests transition for a window container which will be removed or invisible. */
    void requestCloseTransitionIfNeeded(@NonNull WindowContainer<?> wc) {
        if (mTransitionPlayer == null) return;
    /**
     * Requests transition for a window container which will be removed or invisible.
     * @return the new transition if it was created for this request, `null` otherwise.
     */
    Transition requestCloseTransitionIfNeeded(@NonNull WindowContainer<?> wc) {
        if (mTransitionPlayer == null) return null;
        Transition out = null;
        if (wc.isVisibleRequested()) {
            if (!isCollecting()) {
                requestStartTransition(createTransition(TRANSIT_CLOSE, 0 /* flags */),
                out = requestStartTransition(createTransition(TRANSIT_CLOSE, 0 /* flags */),
                        wc.asTask(), null /* remoteTransition */, null /* displayChange */);
            }
            collectExistenceChange(wc);
@@ -591,6 +595,7 @@ class TransitionController {
            // collecting, this should be a member just in case.
            collect(wc);
        }
        return out;
    }

    /** @see Transition#collect */