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

Commit 32e09f35 authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Revert "Make leash cleanup on-demand instead of default."

This reverts commit aa02d1b4.

Reason for revert: partial revert to CP fix to b/404507270. The end state is the same as currently at ToT, but need to have cherry-pickable CLs for branches that are in CP mode.

Change-Id: I0a71ffba496db856ba29ebe9ab9b453aad927bc4
parent f7a7621c
Loading
Loading
Loading
Loading
+5 −16
Original line number Diff line number Diff line
@@ -79,15 +79,6 @@ public abstract class RemoteAnimationRunnerCompat extends IRemoteAnimationRunner

    /** Wraps a remote animation runner in a remote-transition. */
    public static RemoteTransitionStub wrap(IRemoteAnimationRunner runner) {
        return wrap(runner, false);
    }

    /**
     * Wraps a remote animation runner in a remote-transition, optionally reparenting the transition
     * leashes to null to explicitly clean them up once the animation is finished.
     */
    public static RemoteTransitionStub wrap(
            IRemoteAnimationRunner runner, boolean reparentLeashesOnFinish) {
        return new RemoteTransitionStub() {
            final ArrayMap<IBinder, Runnable> mFinishRunnables = new ArrayMap<>();

@@ -207,7 +198,6 @@ public abstract class RemoteAnimationRunnerCompat extends IRemoteAnimationRunner
                    // before GC would.
                    info.releaseAllSurfaces();
                    // Make sure that the transition leashes created are not leaked.
                    if (reparentLeashesOnFinish) {
                    for (SurfaceControl leash : leashMap.values()) {
                        try {
                            finishTransaction.reparent(leash, null);
@@ -215,7 +205,6 @@ public abstract class RemoteAnimationRunnerCompat extends IRemoteAnimationRunner
                            Log.e(TAG, "Failed to reparent leash", e);
                        }
                    }
                    }
                    // Don't release here since launcher might still be using them. Instead
                    // let launcher release them (eg. via RemoteAnimationTargets)
                    leashMap.clear();