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

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

Merge "Fix clean-up order when player crashes" into main

parents 50ddd32e efc3c1a4
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -271,13 +271,14 @@ class TransitionController {
        if (mTransitionPlayer == null) return;
        // Immediately set to null so that nothing inadvertently starts/queues.
        mTransitionPlayer = null;
        // Clean-up/finish any playing transitions.
        for (int i = 0; i < mPlayingTransitions.size(); ++i) {
        // Clean-up/finish any playing transitions. Backwards since they can remove themselves.
        for (int i = mPlayingTransitions.size() - 1; i >= 0; --i) {
            mPlayingTransitions.get(i).cleanUpOnFailure();
        }
        mPlayingTransitions.clear();
        // Clean up waiting transitions first since they technically started first.
        for (int i = 0; i < mWaitingTransitions.size(); ++i) {
        // Backwards since they can remove themselves.
        for (int i = mWaitingTransitions.size() - 1; i >= 0; --i) {
            mWaitingTransitions.get(i).abort();
        }
        mWaitingTransitions.clear();