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

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

Merge "Only apply pendingTransaction if hasPendingTransaction is true" into main

parents f83da53e 92c579be
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -3877,8 +3877,8 @@ public final class ViewRootImpl implements ViewParent,
                mPendingTransitions.clear();
            }

            handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mPendingTransaction,
                    "view not visible");
            handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
                    mPendingTransaction, "view not visible");
        } else if (cancelAndRedraw) {
            mLastPerformTraversalsSkipDrawReason = cancelDueToPreDrawListener
                ? "predraw_" + mAttachInfo.mTreeObserver.getLastDispatchOnPreDrawCanceledReason()
@@ -3893,8 +3893,8 @@ public final class ViewRootImpl implements ViewParent,
                mPendingTransitions.clear();
            }
            if (!performDraw(mActiveSurfaceSyncGroup)) {
                handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mPendingTransaction,
                        mLastPerformDrawSkippedReason);
                handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
                        mPendingTransaction, mLastPerformDrawSkippedReason);
            }
        }

@@ -4772,8 +4772,8 @@ public final class ViewRootImpl implements ViewParent,
            if (mSurfaceHolder != null && mSurface.isValid()) {
                usingAsyncReport = true;
                SurfaceCallbackHelper sch = new SurfaceCallbackHelper(() -> {
                    handleSyncRequestWhenNoAsyncDraw(surfaceSyncGroup, pendingTransaction,
                            "SurfaceHolder");
                    handleSyncRequestWhenNoAsyncDraw(surfaceSyncGroup, pendingTransaction != null,
                            pendingTransaction, "SurfaceHolder");
                });

                SurfaceHolder.Callback callbacks[] = mSurfaceHolder.getCallbacks();
@@ -4787,8 +4787,8 @@ public final class ViewRootImpl implements ViewParent,
        }

        if (!usingAsyncReport) {
            handleSyncRequestWhenNoAsyncDraw(surfaceSyncGroup, pendingTransaction,
                    "no async report");
            handleSyncRequestWhenNoAsyncDraw(surfaceSyncGroup, pendingTransaction != null,
                    pendingTransaction, "no async report");
        }

        if (mPerformContentCapture) {
@@ -4798,13 +4798,14 @@ public final class ViewRootImpl implements ViewParent,
    }

    private void handleSyncRequestWhenNoAsyncDraw(SurfaceSyncGroup surfaceSyncGroup,
            @Nullable Transaction pendingTransaction, String logReason) {
            boolean hasPendingTransaction, @Nullable Transaction pendingTransaction,
            String logReason) {
        if (surfaceSyncGroup != null) {
            if (pendingTransaction != null) {
            if (hasPendingTransaction && pendingTransaction != null) {
                surfaceSyncGroup.addTransaction(pendingTransaction);
            }
            surfaceSyncGroup.markSyncReady();
        } else if (pendingTransaction != null) {
        } else if (hasPendingTransaction && pendingTransaction != null) {
            Trace.instant(Trace.TRACE_TAG_VIEW,
                    "Transaction not synced due to " + logReason + "-" + mTag);
            if (DEBUG_BLAST) {
@@ -9048,8 +9049,8 @@ public final class ViewRootImpl implements ViewParent,
            mAdded = false;
            AnimationHandler.removeRequestor(this);
        }
        handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mPendingTransaction,
                "shutting down VRI");
        handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
                mPendingTransaction, "shutting down VRI");
        WindowManagerGlobal.getInstance().doRemoveView(this);
    }