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

Commit 906c1ed8 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Post reportDrawFinished to the UI thread if running in system" into...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23783213



Change-Id: Iaac61790f2e79a9f4ac35bb085e9fc323033856a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c2b0b1b4 b79178c5
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());