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

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

Merge "Post reportDrawFinished to the UI thread if running in system" into udc-qpr-dev

parents 0a5435a5 536973fd
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -3855,7 +3855,15 @@ public final class ViewRootImpl implements ViewParent,
        mWmsRequestSyncGroupState = WMS_SYNC_PENDING;
        mWmsRequestSyncGroup = new SurfaceSyncGroup("wmsSync-" + mTag, t -> {
            mWmsRequestSyncGroupState = WMS_SYNC_MERGED;
            // See b/286355097. If the current process is not system, then invoking finishDraw on
            // any thread is fine since once it calls into system process, finishDrawing will run
            // 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);
            } else {
                mHandler.postAtFrontOfQueue(() -> reportDrawFinished(t, seqId));
            }
        });
        if (DEBUG_BLAST) {
            Log.d(mTag, "Setup new sync=" + mWmsRequestSyncGroup.getName());