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

Commit 214d744a authored by Evan Rosky's avatar Evan Rosky
Browse files

Only set ready early in AR.finish if it is a self-contained op

Otherwise, it will cause early-ready during, eg, clearTop
launches which can lead to flickers.

Bug: 273206473
Test: Launch messages, go home, launch phone, pick a contact, then
      pick "text". Observe, no black-flash.
Change-Id: I1badf42914514f3922bc3f6ef67eaa7f10711c84
parent bdb7f0b0
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 */