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

Commit d862b98d authored by chaviw's avatar chaviw
Browse files

Unset mNextDrawUseBlastSync if VRI won't draw

There are some checks before attempting to draw in VRI. If we get a
blast sync relayout, but aren't going to draw, unset
mNextDrawUseBlastSync. Otherwise, we end up blocking indefinitely.
There would never be a draw callback so we would never unset that flag.

If there are no pending draws, report back immediately so we don't block
WMS since it could be waiting on the app to draw.

Test: enable shell transitions, unlock device
Bug: 175229445
Change-Id: I8e1f524862e2b9a48949cf6846141d67129c507c
parent 27de08e0
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -3150,6 +3150,8 @@ public final class ViewRootImpl implements ViewParent,

        mImeFocusController.onTraversal(hasWindowFocus, mWindowAttributes);

        final boolean wasReportNextDraw = mReportNextDraw;

        // Remember if we must report the next draw.
        if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_FIRST_TIME) != 0) {
            reportNextDraw();
@@ -3177,12 +3179,25 @@ public final class ViewRootImpl implements ViewParent,
            if (isViewVisible) {
                // Try again
                scheduleTraversals();
            } else if (mPendingTransitions != null && mPendingTransitions.size() > 0) {
            } else {
                if (mPendingTransitions != null && mPendingTransitions.size() > 0) {
                    for (int i = 0; i < mPendingTransitions.size(); ++i) {
                        mPendingTransitions.get(i).endChangingAnimations();
                    }
                    mPendingTransitions.clear();
                }

                // We may never draw since it's not visible. Report back that we're finished
                // drawing.
                if (!wasReportNextDraw && mReportNextDraw) {
                    mReportNextDraw = false;
                    pendingDrawFinished();
                }
            }

            // We were unable to draw this traversal. Unset this flag since we'll block without
            // ever being able to draw again
            mNextDrawUseBlastSync = false;
        }

        if (mAttachInfo.mContentCaptureEvents != null) {