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

Commit 169f3d8c authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "ViewRootImpl: Ensure seqId only increases" into tm-dev

parents 896c2e02 25bdf74a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1742,7 +1742,7 @@ public final class ViewRootImpl implements ViewParent,

        mForceNextWindowRelayout = forceNextWindowRelayout;
        mPendingAlwaysConsumeSystemBars = args.argi2 != 0;
        mSyncSeqId = args.argi4;
        mSyncSeqId = args.argi4 > mSyncSeqId ? args.argi4 : mSyncSeqId;

        if (msg == MSG_RESIZED_REPORT) {
            reportNextDraw();
@@ -7986,7 +7986,10 @@ public final class ViewRootImpl implements ViewParent,
                    insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0,
                    mTmpFrames, mPendingMergedConfiguration, mSurfaceControl, mTempInsets,
                    mTempControls, mRelayoutBundle);
            mSyncSeqId = mRelayoutBundle.getInt("seqid");
            final int maybeSyncSeqId = mRelayoutBundle.getInt("seqid");
            if (maybeSyncSeqId > 0) {
                mSyncSeqId = maybeSyncSeqId;
            }

            if (mTranslator != null) {
                mTranslator.translateRectInScreenToAppWindow(mTmpFrames.frame);
+10 −3
Original line number Diff line number Diff line
@@ -6125,14 +6125,21 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            applyHere = true;
        }

        for (int i = mDrawHandlers.size() - 1; i >= 0; i--) {
            DrawHandler h = mDrawHandlers.get(i);
        final List<DrawHandler> handlersToRemove = new ArrayList<>();
        // Iterate forwards to ensure we process in the same order
        // we added.
        for (int i = 0; i < mDrawHandlers.size(); i++) {
            final DrawHandler h = mDrawHandlers.get(i);
            if (h.mSeqId <= seqId) {
                h.mConsumer.accept(t);
                mDrawHandlers.remove(h);
                handlersToRemove.add(h);
                hadHandlers = true;
            }
        }
        for (int i = 0; i < handlersToRemove.size(); i++) {
            final DrawHandler h = handlersToRemove.get(i);
            mDrawHandlers.remove(h);
        }

        if (hadHandlers) {
            mWmService.mH.removeMessages(WINDOW_STATE_BLAST_SYNC_TIMEOUT, this);