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

Commit 8baa959c authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Fixed issues with transaction synchronization in VRI" into main

parents befcaa72 b919c242
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3964,9 +3964,15 @@ public final class ViewRootImpl implements ViewParent,
            // on a different thread. However, when the current process is system, the finishDraw in
            // system server will be run on the current thread, which could result in a deadlock.
            if (mWindowSession instanceof Binder) {
                reportDrawFinished(t, seqId);
                // The transaction should be copied to a local reference when posting onto a new
                // thread because up until now the SSG is holding a lock on the transaction. Once
                // the call jumps onto a new thread, the lock is no longer held and the transaction
                // send back may be modified or used again.
                Transaction transactionCopy = new Transaction();
                transactionCopy.merge(t);
                mHandler.postAtFrontOfQueue(() -> reportDrawFinished(transactionCopy, seqId));
            } else {
                mHandler.postAtFrontOfQueue(() -> reportDrawFinished(t, seqId));
                reportDrawFinished(t, seqId);
            }
        });
        if (DEBUG_BLAST) {