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

Commit 4b418900 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Null out RemoteTransition after finish callback invoked

* Might be causing refs to be held in launcher
or whichever other process is hosting the remote
transition

Bug: 302551868
Flags: None
Change-Id: I557cdf2b64e50b6576335b3a7af7f7f4fb333e43
parent 346ede2f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public class OneShotRemoteHandler implements Transitions.TransitionHandler {
    private IBinder mTransition = null;

    /** The remote to delegate animation to */
    private final RemoteTransition mRemote;
    private RemoteTransition mRemote;

    public OneShotRemoteHandler(@NonNull ShellExecutor mainExecutor,
            @NonNull RemoteTransition remote) {
@@ -83,6 +83,8 @@ public class OneShotRemoteHandler implements Transitions.TransitionHandler {
                mMainExecutor.execute(() -> {
                    finishCallback.onTransitionFinished(wct);
                });
                Log.d("b/302551868", "OneShotRemoteHandler#start remote anim null");
                mRemote = null;
            }
        };
        Transitions.setRunningRemoteTransitionDelegate(mRemote.getAppThread());
@@ -105,6 +107,8 @@ public class OneShotRemoteHandler implements Transitions.TransitionHandler {
                mRemote.asBinder().unlinkToDeath(remoteDied, 0 /* flags */);
            }
            finishCallback.onTransitionFinished(null /* wct */);
            Log.d("b/302551868", "OneShotRemoteHandler#exception remote anim null");
            mRemote = null;
        }
        return true;
    }
@@ -123,6 +127,8 @@ public class OneShotRemoteHandler implements Transitions.TransitionHandler {
                // so just assume the worst-case and clear the local transaction.
                t.clear();
                mMainExecutor.execute(() -> finishCallback.onTransitionFinished(wct));
                Log.d("b/302551868", "OneShotRemoteHandler#merge remote anim null");
                mRemote = null;
            }
        };
        try {